numero = 29912
interpreted = N
texte = on 4/3/2000 11:30 AM, Andrew Vernon at avernon@dramatools.net wrote:> > On 3/31/00 3:16 PM, Kenneth Grome at ken@simplewebstores.com wrote:> >>> I need to use multiple-selection lists for both queries and data entry.>>> >>> If I'm using [formvariables] to match up the form fields with their>>> corresponding db fields, how would I ensure I could make sure each part of a>>> multiple selection list was stored or queried?>> >> You'll have to disassemble the specific formvariable for this field into its>> components, then reassemble it so the components get used properly in your>> search and append contexts.> > Pardon my ignorance, guys, but how would I do that? An illustrative sample> would help immensely.> > I'm so damn green at this I need watering and fertilizing. :-)When the browser sends form data with a multiple select, you basically get alist of items with name=value pairs like so:multipleMenu=selection AmultipleMenu=selection DmultipleMenu=selection RIf you were to get the value of the select with a standard, singularvariable value like [multipleMenu], you would only get *one* of theselections. So to get all the values selected in a multiple select, you have to use the[formvariables] context and specify which form field to disassemble.Here's a basic code sample for you. This will append a comma delimited listof the selections in a multiple select to a field in a database.========= The select ==================================================== The Append ===========[append db=your.db]SIZES=[formvariablesname=M_SIZES&exact=T][url][value][/url],[/formvariables][/append]================================If you want to take this one step further, you can build your forms with asimple naming convention that will allow you to automate search, replace,and appends with the help of the [formvariables] context. Here's an exampleof an append using this method:If you were to use a naming convention in all your forms where you name allyour text input fields with a prefix of T_ followed by the name of thedatabase field that they will be appended to, and name all your multipleselect inputs with a M_ prefix followed by the name of the database fieldthat a comma delimited list of selected items will be appended to, then thisone [append] context will work for all your forms:============ Append ============[append db=[DB]][formvariables name=F_&exact=F][hideif[index]=1]&[/hideif][getcharsstart=3][name][/getchars]=[url][value][/url][/formvariables][formvariablesname=M_&exact=F][showif [xxyyzz]![name]]&[getcharsstart=3][name][/getchars]=[/showif][url][value][/url],[text]xxyyzz=[name][/text][/formvariables][/append]================================Does that qualify as an illustrative example? Hope it helps.Mike-------------------------------------------------------------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:
Re: REPOST: The old multiple selection bit (Mike Davis 2000)
on 4/3/2000 11:30 AM, Andrew Vernon at avernon@dramatools.net wrote:> > On 3/31/00 3:16 PM, Kenneth Grome at ken@simplewebstores.com wrote:> >>> I need to use multiple-selection lists for both queries and data entry.>>> >>> If I'm using [formvariables] to match up the form fields with their>>> corresponding db fields, how would I ensure I could make sure each part of a>>> multiple selection list was stored or queried?>> >> You'll have to disassemble the specific formvariable for this field into its>> components, then reassemble it so the components get used properly in your>> search and append contexts.> > Pardon my ignorance, guys, but how would I do that? An illustrative sample> would help immensely.> > I'm so damn green at this I need watering and fertilizing. :-)When the browser sends form data with a multiple select, you basically get alist of items with name=value pairs like so:multipleMenu=selection AmultipleMenu=selection DmultipleMenu=selection RIf you were to get the value of the select with a standard, singularvariable value like [multipleMenu], you would only get *one* of theselections. So to get all the values selected in a multiple select, you have to use the[formvariables] context and specify which form field to disassemble.Here's a basic code sample for you. This will append a comma delimited listof the selections in a multiple select to a field in a database.========= The select ==================================================== The Append ===========[append db=your.db]SIZES=[formvariablesname=M_SIZES&exact=T][url][value][/url],[/formvariables][/append]================================If you want to take this one step further, you can build your forms with asimple naming convention that will allow you to automate search, replace,and appends with the help of the [formvariables] context. Here's an exampleof an append using this method:If you were to use a naming convention in all your forms where you name allyour text input fields with a prefix of T_ followed by the name of thedatabase field that they will be appended to, and name all your multipleselect inputs with a M_ prefix followed by the name of the database fieldthat a comma delimited list of selected items will be appended to, then thisone [append] context will work for all your forms:============ Append ============[append db=[DB]][formvariables name=F_&exact=F][hideif[index]=1]&[/hideif][getcharsstart=3][name][/getchars]=[url][value][/url][/formvariables][formvariablesname=M_&exact=F][showif [xxyyzz]![name]]&[getcharsstart=3][name][/getchars]=[/showif][url][value][/url],[text]xxyyzz=[name][/text][/formvariables][/append]================================Does that qualify as an illustrative example? Hope it helps.Mike-------------------------------------------------------------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 Mike Davis
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...