Put javascript function value into input tag value
michael yue
Ranch Hand
Joined: Nov 20, 2003
Posts: 204
posted
0
How can I put a value returned from a javascript function into the value of a input tag. example <input name="ingroup1" type="hidden" value=getGrp()> where getGrp() is the javascript function as below function getGrp() { var thegrp = document.f0.ingroup.value; return thegrp; } The value passed is getGrp() instead of the real value. Thanks.
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15003
posted
0
it needs to called, you are not calling it... <input name="ingroup1" type="hidden" onload="this.value=getGrp()"> Eric
subject: Put javascript function value into input tag value