Re: how to check for no value while using [URL] to prevent cr

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 25518
interpreted = N
texte = >The only time that WebCatalog will return the field name instead of the contents >is if the field has never been used before. The best way to fix this is to >pre-assign a value to that field. Like so (with WebCat 3.x only): > >[Text]Subscriber=Friend[/Text] >. >[!] some time later [/!] >[Subscriber]!Friend]][Subscriber][/ShowIf]> >. >[!] next page [!] >Dear [Subscriber], Blah, blah, blah > >By preassigning a value, you will ensure that any test can be forced to succeed >or fail at will.Another valuable technique that uses something similar to John's concept, but is more universally useful in my opinion, is to assign all the text variables named in your form to blank values, before the form begins, like this:[Text multi=t]subscriber=&name=&address=&city=&state=&zip=[/Text]Because this will set all the form fields to blank values the *first* time the visitor visits your form page. Then use this very simple technique in your form:
See how you do NOT have to use any showif's or hideif's here? This simplifies things quite a bit, don't you think?This technique will set all your form fields to blank values when no formvariables with the same names are passed into the page, and of course this is usually the situation when the visitor first visits your form page.Then when formvariables with the same names *are* passed into the page, such as when the form is revisited a second time so corrections can be made, or when the form is used to do a [replace] in a database -- the formvariables or database field values will override the blank text variable values, thus populating your form with the values you want it to have, instead of blank values!This technique greatly simplifies all your forms!If you use it all the time, you need no longer worry about having the wrong values in your forms -- unless you're inside an orderfile context of course. There are all kinds of disconcerting work-arounds required when you're in an orderfile context and when you happen to use the same variable name as one of the order file's field names -- but that's a different issue entirely ... ================================ Kenneth Grome, WebDNA Consultant 808-737-6499, http://webdna.net ================================------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .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: how to check for no value while using [URL] to prevent cr (Bob Minor 1999)
  2. Re: how to check for no value while using [URL] to prevent cr (Kenneth Grome 1999)
  3. Re: how to check for no value while using [URL] to prevent cr (Christer Olsson 1999)
  4. Re: how to check for no value while using [URL] to prevent cr (Charles Kline 1999)
  5. Re: how to check for no value while using [URL] to prevent cr (Brian B. Burton 1999)
  6. Re: how to check for no value while using [URL] to prevent cr (Charles Kline 1999)
  7. Re: how to check for no value while using [URL] to prevent cr (Christer Olsson 1999)
  8. Re: how to check for no value while using [URL] to prevent cr (Charles Kline 1999)
  9. Re: how to check for no value while using [URL] to prevent cr (Kenneth Grome 1999)
  10. Re: how to check for no value while using [URL] to prevent cr (jpeacock@univpress.com 1999)
  11. Re: how to check for no value while using [URL] to prevent cr (John Butler 1999)
  12. how to check for no value while using [URL] to prevent crashing? (John Butler 1999)
>The only time that WebCatalog will return the field name instead of the contents >is if the field has never been used before. The best way to fix this is to >pre-assign a value to that field. Like so (with WebCat 3.x only): > >[text]Subscriber=Friend[/Text] >. >[!] some time later [/!] >[Subscriber]!Friend]][Subscriber][/ShowIf]> >. >[!] next page [!] >Dear [Subscriber], Blah, blah, blah > >By preassigning a value, you will ensure that any test can be forced to succeed >or fail at will.Another valuable technique that uses something similar to John's concept, but is more universally useful in my opinion, is to assign all the text variables named in your form to blank values, before the form begins, like this:[Text multi=t]subscriber=&name=&address=&city=&state=&zip=[/Text]Because this will set all the form fields to blank values the *first* time the visitor visits your form page. Then use this very simple technique in your form:
See how you do NOT have to use any showif's or hideif's here? This simplifies things quite a bit, don't you think?This technique will set all your form fields to blank values when no formvariables with the same names are passed into the page, and of course this is usually the situation when the visitor first visits your form page.Then when formvariables with the same names *are* passed into the page, such as when the form is revisited a second time so corrections can be made, or when the form is used to do a [replace] in a database -- the formvariables or database field values will override the blank text variable values, thus populating your form with the values you want it to have, instead of blank values!This technique greatly simplifies all your forms!If you use it all the time, you need no longer worry about having the wrong values in your forms -- unless you're inside an orderfile context of course. There are all kinds of disconcerting work-arounds required when you're in an orderfile context and when you happen to use the same variable name as one of the order file's field names -- but that's a different issue entirely ... ================================ Kenneth Grome, WebDNA Consultant 808-737-6499, http://webdna.net ================================------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .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:

eChecks (2000) UPPERCASE (1997) OT: fckeditor weirdness (2005) OT: Version Control (2007) E-Mail (1998) WebCatalog can't find database (1997) DIsplaying Search Result Relevance (2000) [sendmail] questions... (1997) WebCat and WebTV (1997) extending webcatalog (1997) WebCat2 several catalogs? (1997) Email (1998) WebCatalog/Mac 2.1b2 - PIXO (1997) WebCat2b12 - nesting [tags] (1997) RE: what characters are replaced for tab and CR? (1998) Moment of Thanks (1997) upgrading 5.0 --> 5.1g (2004) Problems appending to database (1997) WebCat B13 Mac CGI -- Frames question (1997) Just Testing (1997)