Solved

Using a radio option to trigger form submit.

Posted on 2007-04-03
4
259 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Button and js nou working 3 20
How to resize a div in html 3 39
removing a class in javascript 4 50
Insert Button on a table 16 38
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

821 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