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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Click Radio button to fill field on another form

Status
Not open for further replies.

jmcg

Technical User
Jun 30, 2000
223
GB
I am trying to use a radio button to prefill a field on a form on the same page.
Basically the user search for an item, it give 4 options in form name=options and when they select the radio it should prefill the name on the form name=order
Have search the site and though below should work, however it does not:
<input type=radio name=Results value="Option1" onclick="document.Orders.Item.value=this.value;">

Not really got a clue on Javascript so any help much appreciated.
 
jmcg, javascript is case sensitive so make sure you have the form name correct (you said the name of the form was "order" but you have "document.Orders.Item.value" within your javascript.

Nick
 
here's an example for you

Code:
<form name="form1">
<input type="radio" name="1" value="1" onclick="document.form2.text1.value=this.value;" />1
<input type="radio" name="1" value="2" onclick="document.form2.text1.value=this.value;" />2
<input type="radio" name="1" value="3" onclick="document.form2.text1.value=this.value;" />3
</form>

<form name="form2">
<input type="text" name="text1" />
</form>
 
thanks guys, it was the case that was the problem.
john
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top