/    Sign up×
Community /Pin to ProfileBookmark

submitting form using radio buttons

[B]Hi all,[/B]
I have a small problem, regarding forms and radio buttons,,

Here is the code i have,

[B]The form gets submitted once i click on any radio buttons, but when i see the url i observe that it doesnt have the detail of which radio button is selected. since my next page depends on which radion button is being selected i want that perticular details also to be posted in the url. [/B]

Can anyone help me in altering this code..

[I] My requirement is that the form is submitted when there is change in radio button selected, so i cannot use a seperate submit buttons..[/I]

<HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR=”#FFFFFF”>
<FORM METHOD=GET name=”MyForm” action=”process.asp”>

/* Contains some more components inside the form */

1<INPUT TYPE=”radio” NAME=”one” onClick=”document.MyForm.submit()”><BR>
2<INPUT TYPE=”radio” NAME=”two” onClick=”document.MyForm.submit()”><BR>
3<INPUT TYPE=”radio” NAME=”three” onClick=”document.MyForm.submit()”><BR>
4<INPUT TYPE=”radio” NAME=”four” onClick=”document.MyForm.submit()”><BR>

</FORM>
</BODY>
</HTML>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisJul 12.2006 — It might just be a timing issue. The onclick is performed prior to the standard click action which would be to set the button status. Maybe this would work:
<i>
</i>&lt;INPUT TYPE="radio" ... onClick="this.checked=true;document.MyForm.submit()"&gt;
Copy linkTweet thisAlerts:
@KarthikkauthorJul 13.2006 — Hi davis,

Thank you. I think it will work i tried it on a trial page its working.

I will try it soon in my application if I have any other problem i wil be back to trouble you.

Great going,
×

Success!

Help @Karthikk spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...