Amit20 Posted September 24, 2011 Share Posted September 24, 2011 Hello Everyone! Now this is pretty simple, i want to set a value of textfield into another text field(which is hidden textfield), i m trying in a following manner function setNoOfSub() { var value=document.getElementById('subjectNo').value; document.form1.setNo.value=value; } but the thing is its not getting set. i m getting following exception Uncaught TypeError: Cannot read property of 'setNo' of undefined. Any help will be highly Appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/247765-setting-a-value-in-text-field/ Share on other sites More sharing options...
Amit20 Posted September 24, 2011 Author Share Posted September 24, 2011 Hey everyone i found out the reason, actually it was my mistake only. Actually i was calling this function on Submit button so the page was loaded again because of action="$_SERVER['PHP_SELF']". So thee values assigned was cleared out. ;D :D Quote Link to comment https://forums.phpfreaks.com/topic/247765-setting-a-value-in-text-field/#findComment-1272308 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.