...

View Full Version : Insert text



buildrebuild
07-17-2007, 09:48 PM
I have this link. I want to fill a text box with an id of "first" with the cookie value but it's not working.

<a href="#" onclick="document.getelementById('first').value = 'recent1'">'+getCookie("recent1")+'</a>';

Any idea why not?

Thanks.
C

glenngv
07-18-2007, 02:53 AM
Javascript is case-sensitive.

document.getElementById('first').value = 'recent1'

buildrebuild
07-18-2007, 11:03 PM
Thanks for the reply. It doesn't seem to work. Tearing my hair out now.

glenngv
07-19-2007, 12:59 AM
Can you elaborate? Saying it doesn't work doesn't help.

_Aerospace_Eng_
07-19-2007, 01:07 AM
You should probably post the rest of your code, so we can see how you are outputting the link.

rnd me
07-19-2007, 03:07 AM
I have this link. I want to fill a text box with an id of "first" with the cookie value but it's not working.

<a href="#" onclick="document.getelementById('first').value = 'recent1'">'+getCookie("recent1")+'</a>';

Any idea why not?

Thanks.
C


your code is in the middle of the tag, not in the onclick handler.



//do you mean something like:
<a href="#" onclick="document.getelementById('first').value =getCookie('recent1')" >recent1</a>';



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum