Jump to content

Setting a value in text field


Amit20

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/247765-setting-a-value-in-text-field/
Share on other sites

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 ;D:D :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.