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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.