Forum Moderators: open

Message Too Old, No Replies

Variable Passing

How would one pass this variable best?

         

Jimmyco

8:37 pm on Jan 3, 2011 (gmt 0)

10+ Year Member



I am going to pass a variable from my JavaScript to my php page. My page uses two javascripts: a slider script and then the form script to actually pass the variable "formVar" to the next page. What I can't figure out is how to set the variable "ds" to varible "formVar" in the script below.

A snip from the slider script:

$("ds").innerHTML = slider1.values.mid*slider0.values.mid;

The form javacript:
<a href="#" onclick="document.myform.formVar.value='(ds)'; document.myform.submit(); return false">Link</a><br>

<form method=post name="myform" action="page2.php">
<input type="hidden" name="formVar" value="">
</form>

Thanks in advance for your help! I am going to go help some other people on here in my area of expertise for good Karma.

Jimmyco

10:09 pm on Jan 3, 2011 (gmt 0)

10+ Year Member



Resolved. I am a moron. The solution is:

<a href="#" onclick="document.myform.formVar.value=slider0.values.mid; document.myform.submit(); return false">Link</a><br>