Re: [showif] with !

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 36034
interpreted = N
texte = Wait a second...John Peacock wrote:> This line > > [showif [url][title_req][/url]!][text]complete=F[/text][/showif] > > means create a text variable called complete with a value of F if the > variable [title_req] is _not_ blank. The [url] context will protect > any text within [title_req] from confusing the test. > > However, that is not what this line > > [showif > [countchars][title_req][/countchars]=0][text]complete=F[/text][/showif] > > means; in fact this is the opposite of the first line. This line says > to create the text variable complete equal to F if the field [title_req] > is empty. > > It looks like you want to change the first line to be [hideif] to get > what you want. Or you could change the line to be > > [showif [url][title_req][/url]=][text]complete=F[/text][/showif] > ^ > which will be true if [title_req] is empty or is not present as a form > variable.no. if [title_req] is not present as a formvar, then it will equal literally [title_req], which is *not* the same as being equal to null.Kim see more below...> > > HTH > > John Peacock > > Kim Ingram wrote: > > > > > Figure out where the value of [title_req] is coming from. > > > > > > Is it a db field? or is it a formvar? > > > > > > When displaying the value of [somevar] on a page: > > > > > > if [somevar]'s value is coming from a formvar, then it will > > > display as [somevar] > > > IF that formvar has NOT been passed in (like with a checkbox that > > > was not checked), BUT > > > > > > if [somevar]'s value is coming from a formvar, then it will > > > display as (that's > > > nothing at all in between those quote marks) WHEN that formvar > > > has been passed in w/ a > > > value equal to the null string (i.e. it = zero characters), BUT > > > > > > if [somevar]'s value is coming from a db field, then it will > > > display as (that's > > > nothing at all in between those quote marks) WHEN that db field > > > has nothing in it. > > > > > > > > > so in your case I have to assume that > > > [showif [url][title_req][/url]!][text]complete=F[/text][/showif] > > > does not evaluate to show its contents because 'title_req' has > > > NOT been assigned the > > > null string value, which is what you are comparing to. > > > > I know it's been a few days, but for those of you following this > > thread....the [title_req] is coming from a form, but the problem isn't > > coming from when it is left blank. Everything works fine when the > > [title_req] is left blank. The problem is coming from when > > [title_req]=Anything Ending with !, because that puts two !'s in a row...and > > I don't think WebCatalog knows what to do with it. I've tried the > > following: > > > > [showif [url][title_req][/url]!][text]complete=F[/text][/showif]That showif will show when [title_req] has been passed in with any value other than null. (ie - whenever the user has input something or checked the checkbox)> > > > > [showif [title_req]![raw][title_req][/raw]][text]complete=F[/text][/showif]Assuming no comparison chars are input, then- That showif will show whenever [title_req] has been passed in with any value at all. (ie - whenever the user has input something, or checked the checkbox, or done anything but cause the formvar to not even be present) The problem with this statement is that it does not guard against comparison chars from being input (in the case of text inputs or other cases where you are not in control).> > > > > [showif > > [url][title_req][/url]![raw][title_req][/raw]][text]complete=F[/text][/showif]This is close to what you are after. but notice why it does not do the job: imagine [title_req] has been passed in with a value equal to null (nothing input) then it evaluates to (parsing in slow motion so we can see what happens) -[showif %5Btitle_req%5D![title_req]][text]complete=F[/text][/showif]%5Btitle_req%5D truely does not equal [title_req] so now you see why complete=F even with that showif the way you had it?Try this:[showif [url][title_req][/url]![url][raw][title_req][/raw][/url]][text]complete=F[/text][/showif]-John> > > > > With each of the above, examples, complete=F does show, and I don't want > > it to. I want [title_req] to be anything but blank...not anything but blank > > or ending with ! Does this make sense at all? > > > > Anyway, for those of you who need to know, John Davies' solution worked > > excellent in this case. > > > > [showif > > [countchars][title_req][/countchars]=0][text]complete=F[/text][/showif] > > > > This is the only code so far that will allow [title_req] to be anything but > > blank. > ------------------------------------------------------------- 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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: [showif] with ! (John Peacock 2000)
  2. Re: [showif] with ! (John Butler 2000)
  3. Re: [showif] with ! (Kim Ingram 2000)
  4. Re: [showif] with ! (Rob Marquardt 2000)
  5. Re: [showif] with ! (John Peacock 2000)
  6. Re: [showif] with ! (Kim Ingram 2000)
  7. Re: [showif] with ! (Aaron Lynch 2000)
  8. Re: [showif] with ! (John Butler 2000)
  9. Re: [showif] with ! (John Davies 2000)
  10. Re: [showif] with ! (Kim Ingram 2000)
  11. Re: [showif] with ! (Gary Krockover 2000)
  12. Re: [showif] with ! (Kim Ingram 2000)
  13. Re: [showif] with ! (Kim Ingram 2000)
  14. Re: [showif] with ! (Anup Setty 2000)
  15. Re: [showif] with ! (Charles Kline 2000)
  16. [showif] with ! (Kim Ingram 2000)
Wait a second...John Peacock wrote:> This line > > [showif [url][title_req][/url]!][text]complete=F[/text][/showif] > > means create a text variable called complete with a value of F if the > variable [title_req] is _not_ blank. The [url] context will protect > any text within [title_req] from confusing the test. > > However, that is not what this line > > [showif > [countchars][title_req][/countchars]=0][text]complete=F[/text][/showif] > > means; in fact this is the opposite of the first line. This line says > to create the text variable complete equal to F if the field [title_req] > is empty. > > It looks like you want to change the first line to be [hideif] to get > what you want. Or you could change the line to be > > [showif [url][title_req][/url]=][text]complete=F[/text][/showif] > ^ > which will be true if [title_req] is empty or is not present as a form > variable.no. if [title_req] is not present as a formvar, then it will equal literally [title_req], which is *not* the same as being equal to null.Kim see more below...> > > HTH > > John Peacock > > Kim Ingram wrote: > > > > > Figure out where the value of [title_req] is coming from. > > > > > > Is it a db field? or is it a formvar? > > > > > > When displaying the value of [somevar] on a page: > > > > > > if [somevar]'s value is coming from a formvar, then it will > > > display as [somevar] > > > IF that formvar has NOT been passed in (like with a checkbox that > > > was not checked), BUT > > > > > > if [somevar]'s value is coming from a formvar, then it will > > > display as (that's > > > nothing at all in between those quote marks) WHEN that formvar > > > has been passed in w/ a > > > value equal to the null string (i.e. it = zero characters), BUT > > > > > > if [somevar]'s value is coming from a db field, then it will > > > display as (that's > > > nothing at all in between those quote marks) WHEN that db field > > > has nothing in it. > > > > > > > > > so in your case I have to assume that > > > [showif [url][title_req][/url]!][text]complete=F[/text][/showif] > > > does not evaluate to show its contents because 'title_req' has > > > NOT been assigned the > > > null string value, which is what you are comparing to. > > > > I know it's been a few days, but for those of you following this > > thread....the [title_req] is coming from a form, but the problem isn't > > coming from when it is left blank. Everything works fine when the > > [title_req] is left blank. The problem is coming from when > > [title_req]=Anything Ending with !, because that puts two !'s in a row...and > > I don't think WebCatalog knows what to do with it. I've tried the > > following: > > > > [showif [url][title_req][/url]!][text]complete=F[/text][/showif]That showif will show when [title_req] has been passed in with any value other than null. (ie - whenever the user has input something or checked the checkbox)> > > > > [showif [title_req]![raw][title_req][/raw]][text]complete=F[/text][/showif]Assuming no comparison chars are input, then- That showif will show whenever [title_req] has been passed in with any value at all. (ie - whenever the user has input something, or checked the checkbox, or done anything but cause the formvar to not even be present) The problem with this statement is that it does not guard against comparison chars from being input (in the case of text inputs or other cases where you are not in control).> > > > > [showif > > [url][title_req][/url]![raw][title_req][/raw]][text]complete=F[/text][/showif]This is close to what you are after. but notice why it does not do the job: imagine [title_req] has been passed in with a value equal to null (nothing input) then it evaluates to (parsing in slow motion so we can see what happens) -[showif %5Btitle_req%5D![title_req]][text]complete=F[/text][/showif]%5Btitle_req%5D truely does not equal [title_req] so now you see why complete=F even with that showif the way you had it?Try this:[showif [url][title_req][/url]![url][raw][title_req][/raw][/url]][text]complete=F[/text][/showif]-John> > > > > With each of the above, examples, complete=F does show, and I don't want > > it to. I want [title_req] to be anything but blank...not anything but blank > > or ending with ! Does this make sense at all? > > > > Anyway, for those of you who need to know, John Davies' solution worked > > excellent in this case. > > > > [showif > > [countchars][title_req][/countchars]=0][text]complete=F[/text][/showif] > > > > This is the only code so far that will allow [title_req] to be anything but > > blank. > ------------------------------------------------------------- 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://search.smithmicro.com/ John Butler

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:

Apology to list (2002) Forms Search Questions (1997) WebCatalog and WebMerchant reviewed by InfoWorld (1997) WebCatalog 4.0 has been released! (2000) Integration with SQL (1997) categories (1997) WebCatalog can't find database (1997) textA and Title? (1997) WC 2.0 frames feature (1997) Big Databases (1997) Re1000001: Setting up shop (1997) WebCat Error Log problem (2.0.1, acgi, Mac) (1997) New command suggestion (1997) file browser. (2002) [ot] table gap help?!? (2001) Bug Report, maybe (1997) RE: error count with $purchase (1997) No subject given (2000) Emailer (1998) calculating unique time (1998)