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

Retrive radiovalue value in form without submit button

Status
Not open for further replies.

EMax1

MIS
Apr 8, 2004
95
US
Hi,
I have a form without a submit buton.
In this for I have a few buttons (named 'radiobutton'), and one area map. Cliking on the area map will direct to a page that process the information from the form.
I pass one value when I click on the area map (...xxx.asp?loc=1), but I cannot retrieve the value of the radiobutton. I believe because I am not using a submit button.
How can I retrieve the value selected with the radiobutton?
thanks in advance and I hope I explain to you what I am looking for.
Thanks in advance
 
To get the form information on the other page you will need to submit the form. You dont have to use a submit button for this. You can submit the form using javascript like this:
Code:
<a href="#" onclick="document.myForm.submit();">Submit</a>
However - by using this method you will lose your QueryString value.

I'll have a think about this one.

Tony

Spirax-Sarco - steam traps control valves heat exchangers
Sun Villa - Luxury Florida accommodation
 
You can do this using javascript. The following code is probably IE specific but can easily be modified. All of this runs on the client, so no page refresh is required.

Code:
<script language=javascript>
function handle_radio(ele) {
	if (typeof ele == 'undefined') ele = event.srcElement;
	alert(ele.value);
	alert(ele.getAdjacentText('afterEnd'))
}
</script>

<input type='radio' onclick='handle_radio()' id='rad' name='rad' value=1>Radio 1<br>
<input type='radio' onclick='handle_radio()' id='rad' name='rad' value=2>Radio 2<br>
<input type='radio' onclick='handle_radio()' id='rad' name='rad' value=3>Radio 3<br>
<input type='radio' onclick='handle_radio()' id='rad' name='rad' value=4>Radio 4<br>
<input type='radio' onclick='handle_radio()' id='rad' name='rad' value=5>Radio 5<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top