Hi,
I have <input name="test_score" value="" type="hidden">
in my form
I have a javascript global variable called score1.
the variable is an int but i converted to string by doing: score1 = score + "";
i think javascript does it automatically but i still did it
so i would like to set the value of the hidden form "test_score" as the javascript variable score1
is this possible? and how do i do it?
i tried the following:
Code:
<input name="test_score" value="score1" type="hidden">
<input name="test_score" value=score1 type="hidden">
<input name="test_score" value=javascript:score1 type="hidden">
and after finding something on google i did
<input name="test_score" value="+score1+" type="hidden">
i even tried:
Code:
score1 = score + " is your test score";
var sstr = "<input type='hidden' name='" + score1 + "' value='" + dowhat + "' name='test_scores'>";
document.getElementById("hiddenbit").innerHTML = sstr;
while i had
Code:
<span id="hiddenbit"></span>
inside the form.
thanks