Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Form input type=hidden - is it possible to set values dynamically

 
Chandhrasekar Saravanan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have an form which uses hidden input . is it possible that i can set the value dynamically by click of a button.

For example in the following code
<script language="JavaScript" type="text/javascript" >
var a = "";
function setValue(){
a = "This is testing";
}
<Form name=newForm >
<input type=button Click="return setValue()"
>
<input type=hidden value= a >
</Form >
</script >
[/CODE]
i just wanted to get the value of the input a in hidden field to be controlled by the button.

:roll:
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<input type="button" onclick='document.FormName.HiddenElementName.value="Your Answer"' name="Button" value="Button">
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic