without pressing any buttons???

C

Cem Louis

Hi,

I have a page with 4 radiobuttons on it and no buttons on it. I want
to post the value of the selected radio button to the other page
without pressing any buttons (with only selecting the radio button)
How can I accomplish this??? I made a code block like below but
couldn't make it work???

Thank you,
Cem Louis

<html>
<head>
</head>
<SCRIPT LANGUAGE="Javascript">
function Submit(){
document.getElementById("form1").Submit()
}
</SCRIPT>
<form name="form1" method="post" action="process.php">
<input name="radiobutton" type="radio" value="radiobutton"
onClick="Submit()">Apple<br>
<input name="radiobutton" type="radio" value="radiobutton"
onClick="Submit()">Banana<br>
<input name="radiobutton" type="radio" value="radiobutton"
onClick="Submit()">Peach<br>
<input name="radiobutton" type="radio" value="radiobutton"
onClick="Submit()">Melon
</form>
 
M

McKirahan

Cem Louis said:
Hi,

I have a page with 4 radiobuttons on it and no buttons on it. I want
to post the value of the selected radio button to the other page
without pressing any buttons (with only selecting the radio button)
How can I accomplish this??? I made a code block like below but
couldn't make it work???

Thank you,
Cem Louis

<html>
<head>
</head>
<SCRIPT LANGUAGE="Javascript">
function Submit(){
document.getElementById("form1").Submit()
}
</SCRIPT>
<form name="form1" method="post" action="process.php">
<input name="radiobutton" type="radio" value="radiobutton"
onClick="Submit()">Apple<br>
<input name="radiobutton" type="radio" value="radiobutton"
onClick="Submit()">Banana<br>
<input name="radiobutton" type="radio" value="radiobutton"
onClick="Submit()">Peach<br>
<input name="radiobutton" type="radio" value="radiobutton"
onClick="Submit()">Melon
</form>

Try lowercase "s" for ".submit()".
 
I

Ivo

Try lowercase "s" for ".submit()".

And just for the sake of completeness and crossbrowserness, you might
as well write it in full:

onclick=" this.form.submit(); "
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top