javascript variable in a form
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"> Code:
score1 = score + " is your test score"; Code:
<span id="hiddenbit"></span> thanks |
Code:
document.test_score.value = score1; Code:
document.FORM_NAME.test_score.value = score1; |
[EDIT: scuzzman beat me to the punch]
I'm no javascript expert, but: Code:
document.test.test_score.value = score1 |
works
awesome thanks guys!! |
All times are GMT -5. The time now is 10:40 PM. |