Re: more trouble with [showif] in [search] = busted [shownext]

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 28559
interpreted = N
texte = Hi John,You didn't post your html form, so I really don't have any idea what values the search context is *supposed* to be receiving from your form. Please make sure to post the form next time, so I can see the whole picture instead of just bits and pieces of the puzzle. Thanks. :)Based on my assumptions about what is being passed by your form, you may want to try the following: 1- Make your form pass a v.DayOrdered value to the search page. The v, before the rest of the name distinguishes it as variable value, which is different from a database field value.This technique is not always necessary, but it definitely comes in handy when you need to know which tags reference variables and which tags reference database fields. Basically the technique makes your code a lot more visually understandable, especially for people who didn't write it in the first place and probably don't know the names of your database fields (unless you post them) ... :) 2- Immediately before the search context, use this text context. These text values will be used whenever the same formvariables are not sent from the previous page:[text multi=t]RequireAffil=no&startat=1&max=10[/text]The requireAffil value will be set to no if the visitor fails to check that value in your form, and if he checks it in the form, the formvariable value -- which I assume is yes -- will override the value set in this text context.As far as the startat value is concerned, it will be used only for the first search, because in subsequent searches it is replaced by the start value from the shownext links shown below. And the max value will be used for every search, because there is no max value being passed in the shownext code shown below. 3- Then use this new search context:[Search db=Orders-Main.db &group1field=DayOrdered &group1type=date &mrgroup1datarq=[v.DayOrdered] &xrgroup1datarq=[v.DayOrdered] &DayOrderedtype=date &DayOrderedsort=1 &DayOrderedsdir=de &TimeOrderedtype=time &TimeOrderedsort=2 &TimeOrderedsdir=de [hideif no=[requireAffil]]&eqAffilCodedatarq=[v.AffilCode][/hideif] &allblnk=T &max=[max] &startat=[startat]]As you can see I rewrote your code with the proper group field technique. Don't forget, you CANNOT search a database field with more than one search parameter! You should *always* use the group field technique when addressing a database field more than once in a search context, or you're destined to create problems for yourself ... 4- Now use this shownext code. If you want to change the max value in your shownext searches, all you have to do is add a &max=20 parameter to the shownext string below, then the shownext searches will return 20 items instead of the 10 items they return from the original search:[shownext] Show found orders [start]-[end]
[/shownext]Personally I don't like using the [searchstring] tag because it used to append the same search string to the end of the existing search string each time a shownext link was clicked again. This resulted in ridiculously long search strings with the same parameters repeated over and over again. I don't know if this 'feature' of the [searchstring] tag has been corrected or not, but for me it doesn't matter, because when I create shownext links I like to see every parameter that's being passed when I look at my code on the page, and using [searchstring] hides those parameters from me, thus making debugging more difficult than it needs to be ...:)================================ Kenneth Grome, WebDNA Consultant 808-737-6499 http://webdna.net ================================------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Associated Messages, from the most recent to the oldest:

    
  1. Re: more trouble with [showif] in [search] = busted [shownext] (John Butler 2000)
  2. Re: more trouble with [showif] in [search] = busted [shownext] - SOLVED (John Butler 2000)
  3. Re: more trouble with [showif] in [search] = busted [shownext] (Kenneth Grome 2000)
  4. Re: more trouble with [showif] in [search] = busted [shownext] (John Butler 2000)
  5. Re: more trouble with [showif] in [search] = busted [shownext] (Kenneth Grome 2000)
  6. more trouble with [showif] in [search] = busted [shownext] (John Butler 2000)
Hi John,You didn't post your html form, so I really don't have any idea what values the search context is *supposed* to be receiving from your form. Please make sure to post the form next time, so I can see the whole picture instead of just bits and pieces of the puzzle. Thanks. :)Based on my assumptions about what is being passed by your form, you may want to try the following: 1- Make your form pass a v.DayOrdered value to the search page. The v, before the rest of the name distinguishes it as variable value, which is different from a database field value.This technique is not always necessary, but it definitely comes in handy when you need to know which tags reference variables and which tags reference database fields. Basically the technique makes your code a lot more visually understandable, especially for people who didn't write it in the first place and probably don't know the names of your database fields (unless you post them) ... :) 2- Immediately before the search context, use this text context. These text values will be used whenever the same formvariables are not sent from the previous page:[text multi=t]RequireAffil=no&startat=1&max=10[/text]The requireAffil value will be set to no if the visitor fails to check that value in your form, and if he checks it in the form, the formvariable value -- which I assume is yes -- will override the value set in this text context.As far as the startat value is concerned, it will be used only for the first search, because in subsequent searches it is replaced by the start value from the shownext links shown below. And the max value will be used for every search, because there is no max value being passed in the shownext code shown below. 3- Then use this new search context:[Search db=Orders-Main.db &group1field=DayOrdered &group1type=date &mrgroup1datarq=[v.DayOrdered] &xrgroup1datarq=[v.DayOrdered] &DayOrderedtype=date &DayOrderedsort=1 &DayOrderedsdir=de &TimeOrderedtype=time &TimeOrderedsort=2 &TimeOrderedsdir=de [hideif no=[requireAffil]]&eqAffilCodedatarq=[v.AffilCode][/hideif] &allblnk=T &max=[max] &startat=[startat]]As you can see I rewrote your code with the proper group field technique. Don't forget, you CANNOT search a database field with more than one search parameter! You should *always* use the group field technique when addressing a database field more than once in a search context, or you're destined to create problems for yourself ... 4- Now use this shownext code. If you want to change the max value in your shownext searches, all you have to do is add a &max=20 parameter to the shownext string below, then the shownext searches will return 20 items instead of the 10 items they return from the original search:[shownext] [thisurl] ?v.DayOrdered=[url][v.DayOrdered][/url] &AffilCode=[url][AffilCode][/url] &allblnk=T &startat=[start] &no_cache=[random][random][random]> Show found orders [start]-[end]
[/shownext]Personally I don't like using the [searchstring] tag because it used to append the same search string to the end of the existing search string each time a shownext link was clicked again. This resulted in ridiculously long search strings with the same parameters repeated over and over again. I don't know if this 'feature' of the [searchstring] tag has been corrected or not, but for me it doesn't matter, because when I create shownext links I like to see every parameter that's being passed when I look at my code on the page, and using [searchstring] hides those parameters from me, thus making debugging more difficult than it needs to be ...:)================================ Kenneth Grome, WebDNA Consultant 808-737-6499 http://webdna.net ================================------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Kenneth Grome

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

I'm tired of all this! (2000) Merging databases (1997) problems with 2 tags shakur (1997) WebCat2 beta FTP site (1997) raw field names (2001) Foreign Language [DATE] formats (2004) [ot] html question (2000) Stopping NT WebCat service (1998) Newbie problem blah blah blah (1997) Last Day of the Month (2005) Forms (1998) Blocking off access (2005) Protect (1997) WebCatalog 2.0 & WebDNA docs in HTML ... (1997) WebCatalog 2.0 b 15 mac (1997) FAX orders (1996) pc (1997) WebDNA Solutions ... sorry! (1997) Quick poll (2003) [LOOKUP] (1997)