variables and html

J

John Wilson

I have a javascript variable with a value and I would like a hidden
html text box to contain that value. How can I assign the textbox
value to the javascript variable's value?
 
K

kaeli

I have a javascript variable with a value and I would like a hidden
html text box to contain that value. How can I assign the textbox
value to the javascript variable's value?

document.formName.hiddenName.value = myVariable;


-------------------------------------------------
~kaeli~
Press any key to continue or any other key to quit.
Who is General Failure and why is he reading
my hard disk?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
 
L

Laurent Bugnion, GalaSoft

Hi,

John said:
I have a javascript variable with a value and I would like a hidden
html text box to contain that value. How can I assign the textbox
value to the javascript variable's value?

If you have

<INPUT TYPE="hidden" NAME="myHidden" ID="myHidden" VALUE="">

then you can do

document.formName.myHidden.value = myJavaScriptVariable;

HTH,

Laurent
 
J

John Wilson

Thanks, it's working. I had similiar code but there was a typo! Thanks
again!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,085
Messages
2,570,597
Members
47,219
Latest member
Geraldine7

Latest Threads

Top