Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing a hidden field

Status
Not open for further replies.

tennis

Technical User
Aug 23, 2001
18
US
Hello,

I believe this is a very easy task but I can't seem to make it work. I have a hidden value in my html page and I just want to display it:

<form name=&quot;parm&quot; ......
<input type=&quot;hidden&quot; name=&quot;state&quot; value=&quot;MT&quot;>

I am trying to use alert to view the value : MT

I have used many versions but to no use, the latest being:
alert(form.elements[&quot;geoinfo&quot;].value);

How do I display a specific hidden value?

Thanks in advance.
 
your hidden field is named &quot;state&quot;, but you're calling &quot;geoinfo&quot;?

try: alert(document.forms[0].state.value);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top