www.webdeveloper.com
Results 1 to 3 of 3

Thread: able/disable of drop down list

  1. #1
    Join Date
    Nov 2012
    Posts
    32

    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)

    www.a2zsol.cz.cc

    thanks in advance

  2. #2
    Join Date
    Oct 2012
    Posts
    78
    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:
    <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>

  3. #3
    Join Date
    Nov 2012
    Posts
    32
    thanks theyoker

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles