changing input value atrribute
-
I Need to get the value attribute to change to different numbers that I want to change in script parts based on user input so that the form will post a message to a different place depening on what they choose, but whatever I try it won't change, or at least not in time so that it posts right
document.getElementBytagName("member_id").value="40603"; Hello.
-
I Need to get the value attribute to change to different numbers that I want to change in script parts based on user input so that the form will post a message to a different place depening on what they choose, but whatever I try it won't change, or at least not in time so that it posts right
document.getElementBytagName("member_id").value="40603"; Hello.
document.getElementsByTagName try it this way (it will probably work but there is no gaurentee that the dom will be ready, you should move the script block to the end ot the page)
<input type='hidden' name='member_id' id='number' value='***' />
<script type="text/javascript">
document.getElementById("number").value="40603";
</script> -
document.getElementsByTagName try it this way (it will probably work but there is no gaurentee that the dom will be ready, you should move the script block to the end ot the page)
<input type='hidden' name='member_id' id='number' value='***' />
<script type="text/javascript">
document.getElementById("number").value="40603";
</script> -
Thanks a lot, it worked. One more question.. varibles.. Tried asigning it one like this: int num = 4321; document.getElementById("number").value=num; but that way didn't do it..
Declare the variable as : var num;
-
Declare the variable as : var num;