close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


populating hidden field with a sum

Thread began 6/17/2011 3:17 pm by Brad Lawryk | Last modified 6/18/2011 3:59 pm by Brad Lawryk | 698 views | 2 replies |

Brad Lawryk

populating hidden field with a sum

With Data Assist is it possible to populate a hidden field with the total of two manual input text fields before inserting?

Sign in to reply to this post

Jason ByrnesWebAssist

you would need to use javascript to assign the value on submit.

I assume you want to insert the sum to a database column?

instead of using javascript to set a hidden element, do the math server side to sed the hidden element.

for example if you have form elements named txt1, txt2 and txtSum, add the following at line 1 of the page:


$txt1 = (isset($_POST["txt1"]))?intval($_POST["txt1"]):0;
$txt2 = (isset($_POST["txt2"]))?intval($_POST["txt2"]):0;
$txtSum $txt1 $txt2;
$_POST["txtSum"] = $txtSum  ;

bear in mind that this code assumes the use of integers, if you are using floating point numbers, change intval to floatval.

Sign in to reply to this post

Brad Lawryk

Thank you. I was thinking there may be a way to do it right with the DataAssist tools, but that works as well.

Again, I know sometimes I am very hard on you guys, but no one can deny the tech support service you guys provide. Usually a pretty good answer and in a timely fashion. Thanks again.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...