Unhide the text field

Dear all, I have a textfield which is of hidden type and a button in a web page.whenever i click the button it has to show the text field and its default value in that . can anybody give a solution for this. Thanx in advance. Regards, Vandiyadevan

Tom the person just wants to show a hidden form element on the page....

Tom Blough
Ranch Hand

Joined: Jul 31, 2003
Posts: 263

posted Nov 18, 2003 09:30:00

0

Originally posted by Eric Pascarello: Tom the person just wants to show a hidden form element on the page....

Eric, it's six of one or half a dozen of the other. Use JavaScript to change the visibility, or use JavaScript to add the value to a previously empty text box. It's exactly the same amount of code give or take a few characters.

If someone used your method, then when the form is submitted, any 'hidden' values are sent as empty string, when it in fact they should contain some value. We want to hide the value from a user, not null it.

The requirement of the original poster is fuzzy, and its unclear if a value should be submitted for 'hidden' fields or not. But I thought i'd point out that Erics method and your method do NOT produce the same results server-side. [ November 19, 2003: Message edited by: Mike Curwen ]

Tom Blough
Ranch Hand

Joined: Jul 31, 2003
Posts: 263

posted Nov 20, 2003 14:24:00

0

You are right Mike. I didn't think about if he needed the value in the hidden element. I assumed it was something like an online practice test where the button was "check you answer". That's what I get for assuming