/    Sign up×
Community /Pin to ProfileBookmark

Get radio button value?

I don’t exactly know how to word my issue.

Basically, I need it so that if a user selects ‘option1’ in the group ‘group1’ when they go to ‘group2’ is only gives them a certain selection to choose from. If they choose ‘option2’ in ‘group1’ they will get a different set to choose from.

My main dilemma is it must do this without them having to submit. Would PHP work for this?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJun 19.2010 — You would need to use JavaScript (or other client-side solutions). If desired you could have an AJAX implementation of JavaScript that called PHP on the server to handle the logic, but I wouldn't bother with that unless the logic is really complex and requires some sort of database interaction, which at first glance would not seem to be the case here.

However, you still may need some validation on the server side form-handler (presumably PHP?) to handle situations where users (or hackers) have disabled JavaScript for whatever reason.
Copy linkTweet thisAlerts:
@tirnaJun 19.2010 — if the option values in each group are stored in a database on the $erver, then I would use AJAX (which does not require a submit button) to get the options for group 2 depending on the selection in group 1.

You could also do all this client side without the need for a database by using javascript to store all the options in arrays and then write the appropriate options to group 2 depending on the selection in group 1.
Copy linkTweet thisAlerts:
@SingauthorJun 20.2010 — thank you both! I'll take this to the javascript forum - your help is appreciated!
×

Success!

Help @Sing 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.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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

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