?
Solved

Using a radio option to trigger form submit.

Posted on 2007-04-03
4
Medium Priority
?
268 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 200 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article discusses four methods for overlaying images in a container on a web page
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

862 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