Solved

Using a radio option to trigger form submit.

Posted on 2007-04-03
4
257 Views
Last Modified: 2012-05-05
Hi All,
I have a form which also displays details of database records.
I have added a radio group to control the display of the form.
How can I get the form to submit when one of the radio options in the group have been pressed ? This is to replace the standard submit button.

Many thanks.
0
Comment
Question by:chunky1
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
ThinkPaper earned 50 total points
ID: 18844957
you should be able to use 'onclick' inside your radio buttons..

<input type="radio" onclick="document.formName.submit();">
0
 
LVL 8

Expert Comment

by:jawahar_prasad
ID: 18845392
<html>
<head>
<title>Submit Tutorial</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="a.html">
  <input name="radiobutton" type="radio" value="radiobutton" onclick="javascript: submit();" />
</form>
</body>
</html>
0
 
LVL 1

Author Comment

by:chunky1
ID: 18849110
That was so easy I feel silly !
0
 
LVL 16

Expert Comment

by:ThinkPaper
ID: 18850792
ah.. everyone has brain farts sometimes =)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now