numero = 18187
interpreted = N
texte = It's an interesting trick, but I sure wouldn't trust it in any sort ofcritical application. You are relying on how the browser interpretsmultiple input fields with the same name, and since this is an HTML no-no(except for groups of radio buttons and groups of checkboxes) you can't beat all confident that any two browsers (or servers for that matter) aregoing to handle it in the same way. A better way to accomplish theself-updating page is:---update.html----[ShowIf [action]=update] [Replace db=sample.db&eqSKUdatarq=1]Choice1=[HideIf[Choice1]=[Raw][Choice1][/Raw]][Choice1][/HideIf]&Choice2=[HideIf[Choice2]=[Raw][Choice1][/Raw]][Choice2][/HideIf][/Replace][/ShowIf][Search db=samples.db&eqSKUdatarq=1][FoundItems] [/FoundItems][/Search]------------------If you access the page from a normal hypertext link, it will just displayyour form with whatever data is in the db. When you re-load the page bysubmiting the form, the hidden variable action triggers the [ShowIf] atthe top of the page, your data gets [Replace]d and the form is updated withthe new data.-DaveAt 3:55 PM 6/11/98, Laurent Pladys wrote:>I have just discovered a way of updating checkbox fields in a database>with only one page ...>>Let say you have the following database :>( choice1 and choice2 are checkboxes in your input form)>------sample.db----->sku choice1 choice2>1 on>-------------------->>If you want to update the content of the checkboxes, usually you have a>first page containing>>Choice 1 : [choice1]=on]checked[/showif]>>
>Choice 2: [choice2]=on]checked[/showif]>>>and in the following page you have to check for the value entered to>update the database with something like that in a replace context>>[showif [choice1]=on]&choice1=on[/showif][showif>[choice1]!on]&choice1=[/showif][showif>>[choice2]=on]&choice2=on[/showif][showif [choice2]!on]&choice2=[/showif]>>Which is not really developper friendly, especially if you want to update>a lot of checkboxes ....>>Now you can update the checkbow from WITHIN the form :>>Choice 1 : [choice1]=on]checked[/showif]>>>
>Choice 2: [choice2]=on]checked[/showif]>>>>Try it for yoursel with the sample database sample.db and the following>page wich auto display itself after you update it (you can edit sample.db>after changing the checkbox to see that it has been updated)>>----- update.tmpl ----->>>
>update checkbox>>>
Update me !
>[search db=update.db&eqskudata=1]>[founditems]>>[/founditems]>>>---------->>Sorry if everybody already knew that but I found this trick very useful.>>Enjoy,>>laurent>>--->Laurent Pladys>LXir>> L a u r e n t P l a d y s>---------------------------------------------> L X i r>_____________________________________________> 1 5 5 r u e d e P i c p u s> 7 5 0 1 2 P a r i s> F r a n c e>_____________________________________________> +33 (0)1 44 68 80 60 (tel)> +33 (0)1 44 68 80 61 (fax)>_____________________________________________> w w w . L X i r . n e t> l t p l a d y s @ L X i r . n e to--------------- Dave MacLeay --+o----------- Digital Frontier --+o--- dave@digitalfrontier.com --+
Associated Messages, from the most recent to the oldest:
It's an interesting trick, but I sure wouldn't trust it in any sort ofcritical application. You are relying on how the browser interpretsmultiple input fields with the same name, and since this is an HTML no-no(except for groups of radio buttons and groups of checkboxes) you can't beat all confident that any two browsers (or servers for that matter) aregoing to handle it in the same way. A better way to accomplish theself-updating page is:---update.html----[ShowIf [action]=update] [Replace db=sample.db&eqSKUdatarq=1]Choice1=[HideIf[Choice1]=[raw][Choice1][/Raw]][Choice1][/HideIf]&Choice2=[HideIf[Choice2]=[raw][Choice1][/Raw]][Choice2][/HideIf][/Replace][/ShowIf][Search db=samples.db&eqSKUdatarq=1][founditems] [/FoundItems][/Search]------------------If you access the page from a normal hypertext link, it will just displayyour form with whatever data is in the db. When you re-load the page bysubmiting the form, the hidden variable action triggers the [showif] atthe top of the page, your data gets [replace]d and the form is updated withthe new data.-DaveAt 3:55 PM 6/11/98, Laurent Pladys wrote:>I have just discovered a way of updating checkbox fields in a database>with only one page ...>>Let say you have the following database :>( choice1 and choice2 are checkboxes in your input form)>------sample.db----->sku choice1 choice2>1 on>-------------------->>If you want to update the content of the checkboxes, usually you have a>first page containing>>Choice 1 : [choice1]=on]checked[/showif]>>
>Choice 2: [choice2]=on]checked[/showif]>>>and in the following page you have to check for the value entered to>update the database with something like that in a replace context>>[showif [choice1]=on]&choice1=on[/showif][showif>[choice1]!on]&choice1=[/showif][showif>>[choice2]=on]&choice2=on[/showif][showif [choice2]!on]&choice2=[/showif]>>Which is not really developper friendly, especially if you want to update>a lot of checkboxes ....>>Now you can update the checkbow from WITHIN the form :>>Choice 1 : [choice1]=on]checked[/showif]>>>
>Choice 2: [choice2]=on]checked[/showif]>>>>Try it for yoursel with the sample database sample.db and the following>page wich auto display itself after you update it (you can edit sample.db>after changing the checkbox to see that it has been updated)>>----- update.tmpl ----->>>
>update checkbox>>>
Update me !
>[search db=update.db&eqskudata=1]>[founditems]>>[/founditems]>>>---------->>Sorry if everybody already knew that but I found this trick very useful.>>Enjoy,>>laurent>>--->Laurent Pladys>LXir>> L a u r e n t P l a d y s>---------------------------------------------> L X i r>_____________________________________________> 1 5 5 r u e d e P i c p u s> 7 5 0 1 2 P a r i s> F r a n c e>_____________________________________________> +33 (0)1 44 68 80 60 (tel)> +33 (0)1 44 68 80 61 (fax)>_____________________________________________> w w w . L X i r . n e t> l t p l a d y s @ L X i r . n e to--------------- Dave MacLeay --+o----------- Digital Frontier --+o--- dave@digitalfrontier.com --+
Dave MacLeay
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...