Re: SHOWIF/HIDEIF empty fields

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 61894
interpreted = N
texte = I wonder why you're not avoiding the use of raw contexts by using this technique instead: [showif [url][field][/url]=] .... this is shown when [fieldname] is blank ... [/showif] Of course you should be [url]ing your [field] value as in this example -- to prevent any comparison operators from screwing up your showif comparisons. By the way, when I know that the visitor cannot enter an ending webdna bracket (which would become part of the [field] value) I sometimes use this technique because it's even more efficient: [showif =[field]] .... this is shown when [fieldname] is blank ... [/showif] This works when the the [field] value does NOT have an ending bracket in it, such as in fields that are not editable by the visitor -- hidden, radio, checkbox and select -- assuming you do not put the ending bracket in one of these field values yourself! The bottom line is that I haven't used raw contexts for this purpose in years ... not that it doesn't work but it seems there are more efficient coding techniques to use in this case. But I actually think you've confused the place where you're using [raw] contexts anyways. Aren't you actually using them in your edit forms, and not on the pages that follow your form submissions? The reason I ask is because the [field] values in the page after the form submission are always going to have values, even if they are [blank] values. In other words, putting a [fieldname] tag on this page is never going to result in the raw [field] tag being displayed because that form field will always have a value that's set in the form, even if that value is blank -- unless it's a checkbox field that was not checked of course, because that's the only HTML form that does NOT get passed as a name-value pair in a form submission. Sincerely, Kenneth Grome www.kengrome.com On May 2, 2005, at 08:15, Gary Krockover wrote: > What if the field isn't empty but rather is equal to the field name > itself? I.e., I find that I often have to do this, especially after a > form submission: > > [showif [FIELD]=[raw][FIELD][/raw]] ... [/showif] > > Depending on what I'm doing, I can sometimes "clear" all the fields on > the landing page ([text show=f]FIELD=[/text]) but not always. > > Is that just me or is this fairly common (I suspect not)? :) > > GJK ------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: SHOWIF/HIDEIF empty fields ( Terry Wilson 2005)
  2. Re: SHOWIF/HIDEIF empty fields ( Kenneth Grome 2005)
  3. Re: SHOWIF/HIDEIF empty fields ( Donovan Brooke 2005)
  4. Re: SHOWIF/HIDEIF empty fields ( Lester 2005)
  5. Re: SHOWIF/HIDEIF empty fields ( Donovan Brooke 2005)
  6. Re: SHOWIF/HIDEIF empty fields ( Frank Nordberg 2005)
  7. Re: SHOWIF/HIDEIF empty fields ( Stuart Tremain 2005)
  8. Re: SHOWIF/HIDEIF empty fields ( Kenneth Grome 2005)
  9. Re: SHOWIF/HIDEIF empty fields ( Bob Minor 2005)
  10. Re: SHOWIF/HIDEIF empty fields ( "WebDna @ Inkblot Media" 2005)
  11. Re: SHOWIF/HIDEIF empty fields ( Kenneth Grome 2005)
  12. Re: SHOWIF/HIDEIF empty fields ( Donovan Brooke 2005)
  13. Re: SHOWIF/HIDEIF empty fields -- OOPS ( Gary Krockover 2005)
  14. Re: SHOWIF/HIDEIF empty fields ( Gary Krockover 2005)
  15. Re: SHOWIF/HIDEIF empty fields ( Kenneth Grome 2005)
  16. Re: SHOWIF/HIDEIF empty fields ( Stuart Tremain 2005)
  17. Re: SHOWIF/HIDEIF empty fields ( Gary Krockover 2005)
  18. Re: SHOWIF/HIDEIF empty fields ( Stuart Tremain 2005)
  19. Re: SHOWIF/HIDEIF empty fields ( Gary Krockover 2005)
  20. Re: SHOWIF/HIDEIF empty fields ( Stuart Tremain 2005)
  21. Re: SHOWIF/HIDEIF empty fields ( Kenneth Grome 2005)
  22. Re: SHOWIF/HIDEIF empty fields ( Donovan Brooke 2005)
  23. Re: SHOWIF/HIDEIF empty fields ( Kenneth Grome 2005)
  24. Re: SHOWIF/HIDEIF empty fields ( Frank Nordberg 2005)
  25. Re: SHOWIF/HIDEIF empty fields ( Kenneth Grome 2005)
  26. SHOWIF/HIDEIF empty fields ( Frank Nordberg 2005)
I wonder why you're not avoiding the use of raw contexts by using this technique instead: [showif [url][field][/url]=] .... this is shown when [fieldname] is blank ... [/showif] Of course you should be [url]ing your [field] value as in this example -- to prevent any comparison operators from screwing up your showif comparisons. By the way, when I know that the visitor cannot enter an ending webdna bracket (which would become part of the [field] value) I sometimes use this technique because it's even more efficient: [showif =[field]] .... this is shown when [fieldname] is blank ... [/showif] This works when the the [field] value does NOT have an ending bracket in it, such as in fields that are not editable by the visitor -- hidden, radio, checkbox and select -- assuming you do not put the ending bracket in one of these field values yourself! The bottom line is that I haven't used raw contexts for this purpose in years ... not that it doesn't work but it seems there are more efficient coding techniques to use in this case. But I actually think you've confused the place where you're using [raw] contexts anyways. Aren't you actually using them in your edit forms, and not on the pages that follow your form submissions? The reason I ask is because the [field] values in the page after the form submission are always going to have values, even if they are [blank] values. In other words, putting a [fieldname] tag on this page is never going to result in the raw [field] tag being displayed because that form field will always have a value that's set in the form, even if that value is blank -- unless it's a checkbox field that was not checked of course, because that's the only HTML form that does NOT get passed as a name-value pair in a form submission. Sincerely, Kenneth Grome www.kengrome.com On May 2, 2005, at 08:15, Gary Krockover wrote: > What if the field isn't empty but rather is equal to the field name > itself? I.e., I find that I often have to do this, especially after a > form submission: > > [showif [FIELD]=[raw][FIELD][/raw]] ... [/showif] > > Depending on what I'm doing, I can sometimes "clear" all the fields on > the landing page ([text show=f]FIELD=[/text]) but not always. > > Is that just me or is this fairly common (I suspect not)? :) > > GJK ------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/ 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:

RequiredFields template (1997) NetSplat and WebCat2 (1997) Requiring that certain fields be completed (1997) Converting spaces to + in results list (SOLVED) (2000) [OT] Redhat 6.1 (2003) Unique SKU Numbers (2000) &fieldsdir=ra truely random?? (2000) Unceremonious Unwanted Unsubscription (1999) WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997) Web Cat and MS SQL 6.5 (1999) Counting LineItems (2000) typhoon vs. webcatalog (1997) My URL, Your URL (2002) 2 easy questions re: [showif] and [sendmail] (1997) Upgrading 2.1 (2000) Merry Christmas (2002) [ShowIf] and empty fields (1997) Search returns all, not 20 (1997) Sort Order on a page search (1997) Duplicate Cart Numbers (1999)