Re: Formvariables name matching

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 63585
interpreted = N
texte = I use a this code to create variables of what is sent in a form: [formvariables][text]name_[name]=[name][/text][/formvariables] I then use these variable to make other T/F variables because the form contents change when submitted and this allows me to chage the way the SAME page looks depending on what was sent in the form. [text]var_cat=0[/text][showif [name_cat]=cat][text]var_cat=1[/text][/showif] [text]var_from=0[/text][showif [name_from]=from][text]var_from=1[/text][/showif] [text]var_findin=0[/text][showif [name_findin]=findin][text]var_findin=1[/text][/showif] [text]var_group=0[/text][showif [name_group]=group][text]var_group=1[/text][/showif] then depending on the conditions above I can format my page results. I also can show the Search criteria used. This was the only way I could evaluate What Values were sent in a form and how to act on them. If there is No value for say 'var_cat' then it is not processed. Otherwise if you try and use a [var_cat] in the page when there is no value sent from the form... you get [var_cat] printed in the page. -- Regards, Marko On Friday, 9 December 2005 5:42 PM, William DeVaul wrote: How does formvariables match by name? In one case I have formvariables name=1_vendorname and in another I have name=_1_vendorname. I can't understand why the first one fails but the second works. Does the formvariables with an inexact match match in the middle of the name rather than at the start? --------------Sample code------------ This works as expected: [showif submit=[submit]] [formvariables name=sku_&exact=F] SKU=[text show=T]keyfieldsku=[value][/text]
[formvariables name=_[value]_&exact=F] [grep search=^_[keyfieldsku]_&replace=][NAME]:[/grep]=[value]
[/formvariables] 
[/formvariables] [/showif] Example output for above code: SKU=1 VENDORNAME:=This is the name of vendor1 VENDORADDRESS:=This is the address of vendor1 SKU=2 VENDORNAME:=This is the name of vendor2 VENDORADDRESS:=This is the address of vendor2 This does not work as expected (I have changed the form to remove the _ at the front of the var name.): [showif submit=[submit]] [formvariables name=sku_&exact=F] SKU=[text show=T]keyfieldsku=[value][/text]
[formvariables name=[value]_&exact=F] [grep search=^[keyfieldsku]_&replace=][NAME]:[/grep]=[value]
[/formvariables] 
[/formvariables] [/showif] Example output: SKU=1 VENDORNAME:=This is the name of vendor1 VENDORADDRESS:=This is the address of vendor1 21_VENDORNAME:=This is the name of vendor21 21_VENDORADDRESS:=This is the address of vendor21 31_VENDORNAME:=This is the name of vendor31 31_VENDORADDRESS:=This is the address of vendor31 ------------------------------------------------------------- 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/ ------------------------------------------------------------- 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: Formvariables name matching ( Marko Bernyk 2005)
  2. Re: Formvariables name matching ( Donovan Brooke 2005)
  3. Re: Formvariables name matching ( Stuart Tremain 2005)
  4. Re: Formvariables name matching ( William DeVaul 2005)
  5. Re: Formvariables name matching ( Stuart Tremain 2005)
  6. Formvariables name matching ( William DeVaul 2005)
I use a this code to create variables of what is sent in a form: [formvariables][text]name_[name]=[name][/text][/formvariables] I then use these variable to make other T/F variables because the form contents change when submitted and this allows me to chage the way the SAME page looks depending on what was sent in the form. [text]var_cat=0[/text][showif [name_cat]=cat][text]var_cat=1[/text][/showif] [text]var_from=0[/text][showif [name_from]=from][text]var_from=1[/text][/showif] [text]var_findin=0[/text][showif [name_findin]=findin][text]var_findin=1[/text][/showif] [text]var_group=0[/text][showif [name_group]=group][text]var_group=1[/text][/showif] then depending on the conditions above I can format my page results. I also can show the Search criteria used. This was the only way I could evaluate What Values were sent in a form and how to act on them. If there is No value for say 'var_cat' then it is not processed. Otherwise if you try and use a [var_cat] in the page when there is no value sent from the form... you get [var_cat] printed in the page. -- Regards, Marko On Friday, 9 December 2005 5:42 PM, William DeVaul wrote: How does formvariables match by name? In one case I have formvariables name=1_vendorname and in another I have name=_1_vendorname. I can't understand why the first one fails but the second works. Does the formvariables with an inexact match match in the middle of the name rather than at the start? --------------Sample code------------ This works as expected: [showif submit=[submit]] [formvariables name=sku_&exact=F] SKU=[text show=T]keyfieldsku=[value][/text]
[formvariables name=_[value]_&exact=F] [grep search=^_[keyfieldsku]_&replace=][NAME]:[/grep]=[value]
[/formvariables] 
[/formvariables] [/showif] Example output for above code: SKU=1 VENDORNAME:=This is the name of vendor1 VENDORADDRESS:=This is the address of vendor1 SKU=2 VENDORNAME:=This is the name of vendor2 VENDORADDRESS:=This is the address of vendor2 This does not work as expected (I have changed the form to remove the _ at the front of the var name.): [showif submit=[submit]] [formvariables name=sku_&exact=F] SKU=[text show=T]keyfieldsku=[value][/text]
[formvariables name=[value]_&exact=F] [grep search=^[keyfieldsku]_&replace=][NAME]:[/grep]=[value]
[/formvariables] 
[/formvariables] [/showif] Example output: SKU=1 VENDORNAME:=This is the name of vendor1 VENDORADDRESS:=This is the address of vendor1 21_VENDORNAME:=This is the name of vendor21 21_VENDORADDRESS:=This is the address of vendor21 31_VENDORNAME:=This is the name of vendor31 31_VENDORADDRESS:=This is the address of vendor31 ------------------------------------------------------------- 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/ ------------------------------------------------------------- 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/ Marko Bernyk

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:

Credit Card Number checking (1997) can you take a look (2003) [AppendFile] problem (WebCat2b13 Mac .acgi) (1997) Database cloning- will the real -oRiGiNaL- please stand up (2003) Duplicate Cart ID (2001) CSV import suggestions (2007) Weird Math and SV (1997) F3 crashing server (1997) b12 cannot limit records returned and more. (1997) WebCat2 - [format thousands] (1997) RE: Any limit to [include] (1997) Where is f2? (1997) Re[2]: 2nd WebCatalog2 Feature Request (1996) serial number dishing (1997) $Replace with [founditems] (1997) Emailer setup (1997) Need help!! on searching in two databases. (1998) WebCat2 - storing unformatted date data? (1997) Emailer help....! (1997) Graphing Modules (2004)