/    Sign up×
Community /Pin to ProfileBookmark

Radio Button Selection + From submission

Hi Friends,

I am creating soem forms in html and I am having difficulties in making the following thing to work.

In a html page have a form and that has two options using radio buttons:
1)Yes
2)No

If they select the “YES”option then div appears and then they fill the details and hit submit then it validates if they missed any requied fields.

If they select the “NO” option they will have again two options using Radiobuttons..This is the place where I am struck.If they select one of the radiobuttons and fill the fields and hit submit then it should validates that form alone and then submit it..and same way if they select the other option.
My question how to make it work based upon the selection??Flow is like this.

Choose : YES
NO
If (yes) then
<a div appears with fields for user to enter> and then hit submit to proceed..form is validated when they hit submit.

If(No) then
< a div appears and it has two options using radio buttons>
Option 1
<contains two fields>
Option 2
<contains three fields>

Here if they fill the fields under anyone of the radio button and hit submit then validation shud happen only for this filled fields and then proceed to next page…but whats happening now is if the fields under one radio button is filled in right way and then hit submit then the valdiation is looking for the non-filled fileds under the second radio button and it doenst proceed.

Hope I am clear in expaling my problem.

Thanks in advance
Pragan.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @pragan 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...