/    Sign up×
Community /Pin to ProfileBookmark

able/disable of drop down list

Hi,

in my website there is a form. How can i able/ disable drop down list (of number of children) based on selection (radio button) of certain options.

In other words when someone selects option children then ‘number of children’ drop down list activates otherwise remains disable (or grey)

here is the form (on second step)

[url]www.a2zsol.cz.cc[/url]

thanks in advance

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@theyokerDec 05.2012 — Couldn't you simply do this through JS?

[CODE]
<script type="text/javascript">
$("#Yes").click(function() {
$("#selection").attr("disabled", false);
//$("#selection").show();
});
$("#No").click(function() {
$("#selection").attr("disabled", true);
//$("#selection").hide();
});
</script>
[/CODE]


[CODE]
<select name="selection" id="selection" disabled="disabled">
<option value="one potato" selected="selected">One potato</option>
<option value="two potato">two potato</option>
<option value="three potato">three potato</option>
</select>

[/CODE]
Copy linkTweet thisAlerts:
@GlobalsupportauthorDec 07.2012 — thanks theyoker
×

Success!

Help @Globalsupport 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.3,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

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