View Full Version : Converting variable to form variable

02-05-2007, 07:55 PM
I am an amateur JS coder and have been unable to find a solution to this problem on the web...

I have a mixture of form variables and javascript variables that I need to mix together into one set of form variables to be posted.

Does anyone know how I can combine literal form elements with javascript variables (somehow converted into form variables at the time of the post) into one post?


02-05-2007, 08:38 PM
If you have a pre-set number of things, use hidden form fields and set the values before submit.
If a dynamic number of things, dynamically create new form fields and set them before submit.

Of course, either of these require script on the client, and so should have a fallback for users with no script on sites that must meet ADA requirements.