This week's book giveaway is in the Testing forum.
We're giving away four copies of Practical Unit Testing with TestNG and Mockito and have Tomek Kaczanowski on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Form input type=hidden  - is it possible to set values dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Form input type=hidden  - is it possible to set values dynamically" Watch "Form input type=hidden  - is it possible to set values dynamically" New topic
Author

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

Chandhrasekar Saravanan
Ranch Hand

Joined: Jun 16, 2002
Posts: 57
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

Joined: Nov 08, 2001
Posts: 15003
<input type="button" onclick='document.FormName.HiddenElementName.value="Your Answer"' name="Button" value="Button">
 
 
subject: Form input type=hidden - is it possible to set values dynamically
 
Threads others viewed
request.getParameter() and JavaScript
Need help with Jquery
How to dispatch different web pages by clicking ddifferent buttons in Form
How to set multiple parametes in a form
Default Enter key and submit BUTTON
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com