Validate a text field with radio button
First of all I appreciate in advance any attempt to help me.
I am new at scripts and I have a important project to develop and I was wondering if someone can help me.
I have a form with few radio buttons, a text field and a submit button.
My objective is to make that when selected a radio button the text field gets a specific URL.
Basically I have a few databases URLs and I want that when a specific radio button is selected (one database), the text field selects that URL and search on it.
Thank you all again!
No change is required to the following except to specify your url and the name in red must reference the name of the target text field:
<input type="radio" name="radioButtonName" value="someurl"
onclick="textFieldName.value = this.value; return true;">
First many thanks for helping. Really!
About your code, I had integrated it and when the radio box is selected, replies the url into the text field.
What I want is, have a few radio buttons(all of them with different urls associated), a text field and a submit button. Select a radio button and make a search on the text field.
Many thanks again MrNobody.
So just duplicate this part into each radio button:
onclick="textFieldName.value = this.value; return true;"
You could also create a function out of this if you want to save a few bytes of bandwidth.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread