Welcome to WebmasterWorld Guest from 18.104.22.168 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Subscribe to WebmasterWorld
I'm very new to scripting and essentially I want to have a form that does a simple calculation based on the value entered in a text field times but the value selected in a radio. I want it to dynamically update the value in the second text field when the radio button is selected without having to click a button. I've tried the following but it doesn't work. Any advice most welcome.
<INPUT TYPE="TEXT" NAME="number1"> x 2<INPUT TYPE="radio" NAME="number2" value="2" onClick="this.form.answer.value = (this.form.number1.value - 0) * (this.form.number2.value - 0)"> 3<INPUT TYPE="radio" NAME="number2" value="3" onClick="this.form.answer.value = (this.form.number1.value - 0) * (this.form.number3.value - 0)"> <INPUT TYPE="TEXT" NAME="answer"> </FORM>
grnidone msg:1492414 6:57 pm on Jan 20, 2002 (gmt 0)
Hi dawlish, Change the name in the second radio button to "number3" and it will work.