/    Sign up×
Community /Pin to ProfileBookmark

How refer to selected Radio button value in forms?

Hi,
I use a dynamic form with xhtml that hides part of the form until the user select one of three radio buttons.

on submit, I validate different fields depending on the radio button selection. How do I refer to the radio button value that is selected? all the methods I tried show “undefined” as the value.
Thanks

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@djbrinkauthorMar 20.2006 — I got the way to find the vlaue of a radio button on the following website:

it boils down to putting the radio button variable in a for loop first finding which one is checked, then extracting the value with another variable out of the array.

Now you know too.

http://www.webdevelopersnotes.com/tips/html/finding_the_value_of_a_radio_button.php3
×

Success!

Help @djbrink 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.15,
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,
)...