NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Devan on April 10, 2012, 08:42:57 PM
-
Is there a quick and easy way within a webform to have a button on screen that can copy the information from one or more fields to another?
A good example is on a shopping cart checkout form for example, where you can copy the billing address to the shipping address etc.
I tried putting code within the [On Change] section (under the 'Server Code' button) in the 'Client-Side' options of the button, and ran code to copy the database fields from one to the other, then also setup the 'Reset' fields on the button to be the destination fields, but nothing happens.
Have I missed something?
Thanks!
-
Hi Devan,
I'd do it just like any other field update;
a) in the "server code" section for the button (ie Validate::fieldname routine)
p_web.SSV('dest',p_web.GSV('source'))
b) then add dest as a "reset field" to the button.
As always, remember to use session variables.
cheers
Bruce
-
Ok, I am doing REALLY well today in the "Answer your own stupid questions" department!! :P
It turns out in the source code to assign the values, I was doing a straight:
FLD:DestField = FLD:OrigField
instead of:
p_web.SSV('FLD:DestField', p_web.GSV('FLD:OrigField'))
Extreme fatigue == Rookie mistakes! ::)
-
As always, remember to use session variables.
Haha Bruce - we typed our replies at the same time... Yes, I made the classic rookie error of using the database fields instead of the session variables. All works great now! :)
-
ahh - you pesky Australians...
Tip: always remember to take _both_ hands off the beer while programming Devan <bg>
Cheers
Bruce