Dependent menus in HTML and JavaScriptFrom dropdown dependent on another dropdown + api requestHow to populate a cascading Dropdown with JQuerypopulate second dropdown based on selected value of first dropdownHow to populate second dropdown in $.ajax() depending on value of first dropdown?Populate second select-dropdown based on choice of first select-dropdown and populate the external content below the radiobuttonsIs there a way to click on a option and have another option popup underneath it?2 level sql php javascript dropdownHow do JavaScript closures work?Which “href” value should I use for JavaScript links, “#” or “javascript:void(0)”?How do I remove a property from a JavaScript object?Which equals operator (== vs ===) should be used in JavaScript comparisons?How do I include a JavaScript file in another JavaScript file?What does “use strict” do in JavaScript, and what is the reasoning behind it?How to check whether a string contains a substring in JavaScript?How do I UPDATE from a SELECT in SQL Server?How do I remove a particular element from an array in JavaScript?Why does HTML think “chucknorris” is a color?

Company stopped paying my salary. What are my options?

What is the minimum required technology to reanimate someone who has been cryogenically frozen?

Why did Missandei say this?

Can I bring back Planetary Romance as a genre?

Does a surprised creature obey the 1st level spell Command?

Renting a house to a graduate student in my department

What is the status of the three crises in the history of mathematics?

How to avoid making self and former employee look bad when reporting on fixing former employee's work?

Publishing an article in a journal without a related degree

if i accidentally leaked my schools ip address and someone d doses my school am i at fault

how to find out if there's files in a folder and exit accordingly (in KSH)

What dice to use in a game that revolves around triangles?

Identity of a supposed anonymous referee revealed through "Description" of the report

What's the difference between "ricochet" and "bounce"?

Row vectors and column vectors (Mathematica vs Matlab)

Examples where existence is harder than evaluation

Are on’yomi words loanwords?

Rusty Chain and back cassette – Replace or Repair?

Can a planet still function with a damaged moon?

Two (probably) equal real numbers which are not proved to be equal?

Employee is self-centered and affects the team negatively

TeX Gyre Pagella Math Integral sign much too small

Do Rabbis admit emotional involvement in their rulings?

Names of the Six Tastes



Dependent menus in HTML and JavaScript


From dropdown dependent on another dropdown + api requestHow to populate a cascading Dropdown with JQuerypopulate second dropdown based on selected value of first dropdownHow to populate second dropdown in $.ajax() depending on value of first dropdown?Populate second select-dropdown based on choice of first select-dropdown and populate the external content below the radiobuttonsIs there a way to click on a option and have another option popup underneath it?2 level sql php javascript dropdownHow do JavaScript closures work?Which “href” value should I use for JavaScript links, “#” or “javascript:void(0)”?How do I remove a property from a JavaScript object?Which equals operator (== vs ===) should be used in JavaScript comparisons?How do I include a JavaScript file in another JavaScript file?What does “use strict” do in JavaScript, and what is the reasoning behind it?How to check whether a string contains a substring in JavaScript?How do I UPDATE from a SELECT in SQL Server?How do I remove a particular element from an array in JavaScript?Why does HTML think “chucknorris” is a color?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-2















I have two <select> fields in my page. The first is shown below with some illustrative brand names:



 <select name="1">
<option value="Apple">Apple</option>
<option value="Samsung">Samsung</option>
<option value="other">Other</option>
</select>


If the user selects "Apple" in this first field, I would like the second to contain Apple's products for the user to choose from, such as



 <select name="Apple">
<option value="iphone">iPhone 7</option>
<option value="ipad">iPad Super Pro</option>
<option value="other">Other</option>
</select>


If it chooses "Samsung", however, I would like to update the second field's options accordingly.



 <select name="Samsung">
<option value="note">Note 6</option>
<option value="galaxy">Galaxy S8</option>
<option value="other">Other</option>
</select>


And if the user chooses "Other", I want an input field to be displayed.



 <input type="text" name="other"/>


How can I do that?










share|improve this question



















  • 1





    That is not possible in pure HTML. You will need some JavaScript for that.

    – Bruno Toffolo
    May 16 '16 at 18:51

















-2















I have two <select> fields in my page. The first is shown below with some illustrative brand names:



 <select name="1">
<option value="Apple">Apple</option>
<option value="Samsung">Samsung</option>
<option value="other">Other</option>
</select>


If the user selects "Apple" in this first field, I would like the second to contain Apple's products for the user to choose from, such as



 <select name="Apple">
<option value="iphone">iPhone 7</option>
<option value="ipad">iPad Super Pro</option>
<option value="other">Other</option>
</select>


If it chooses "Samsung", however, I would like to update the second field's options accordingly.



 <select name="Samsung">
<option value="note">Note 6</option>
<option value="galaxy">Galaxy S8</option>
<option value="other">Other</option>
</select>


And if the user chooses "Other", I want an input field to be displayed.



 <input type="text" name="other"/>


How can I do that?










share|improve this question



















  • 1





    That is not possible in pure HTML. You will need some JavaScript for that.

    – Bruno Toffolo
    May 16 '16 at 18:51













-2












-2








-2








I have two <select> fields in my page. The first is shown below with some illustrative brand names:



 <select name="1">
<option value="Apple">Apple</option>
<option value="Samsung">Samsung</option>
<option value="other">Other</option>
</select>


If the user selects "Apple" in this first field, I would like the second to contain Apple's products for the user to choose from, such as



 <select name="Apple">
<option value="iphone">iPhone 7</option>
<option value="ipad">iPad Super Pro</option>
<option value="other">Other</option>
</select>


If it chooses "Samsung", however, I would like to update the second field's options accordingly.



 <select name="Samsung">
<option value="note">Note 6</option>
<option value="galaxy">Galaxy S8</option>
<option value="other">Other</option>
</select>


And if the user chooses "Other", I want an input field to be displayed.



 <input type="text" name="other"/>


How can I do that?










share|improve this question
















I have two <select> fields in my page. The first is shown below with some illustrative brand names:



 <select name="1">
<option value="Apple">Apple</option>
<option value="Samsung">Samsung</option>
<option value="other">Other</option>
</select>


If the user selects "Apple" in this first field, I would like the second to contain Apple's products for the user to choose from, such as



 <select name="Apple">
<option value="iphone">iPhone 7</option>
<option value="ipad">iPad Super Pro</option>
<option value="other">Other</option>
</select>


If it chooses "Samsung", however, I would like to update the second field's options accordingly.



 <select name="Samsung">
<option value="note">Note 6</option>
<option value="galaxy">Galaxy S8</option>
<option value="other">Other</option>
</select>


And if the user chooses "Other", I want an input field to be displayed.



 <input type="text" name="other"/>


How can I do that?







javascript html select option






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 16 '16 at 19:51









Bruno Toffolo

1,2711423




1,2711423










asked May 16 '16 at 18:49









Box AndroidBox Android

314




314







  • 1





    That is not possible in pure HTML. You will need some JavaScript for that.

    – Bruno Toffolo
    May 16 '16 at 18:51












  • 1





    That is not possible in pure HTML. You will need some JavaScript for that.

    – Bruno Toffolo
    May 16 '16 at 18:51







1




1





That is not possible in pure HTML. You will need some JavaScript for that.

– Bruno Toffolo
May 16 '16 at 18:51





That is not possible in pure HTML. You will need some JavaScript for that.

– Bruno Toffolo
May 16 '16 at 18:51












1 Answer
1






active

oldest

votes


















0














You would need cascading select fields to achieve the desired behavior. This can not be done purely in HTML, and you would need some programming logic in JavaScript to do it as you wish.



The topic is explained in details in the following links:



  • How to populate a cascading Dropdown with JQuery

  • populate second dropdown based on selected value of first dropdown

  • How to populate second dropdown in $.ajax() depending on value of first dropdown?

  • Populate second select-dropdown based on choice of first select-dropdown and populate the external content below the radiobuttons

  • How does one make a cascading drop-down list in HTML with JavaScript?

  • Javascript Cascading Drop Down Menu With 4 Hierarchical Boxes

Note: I didn't flag this question as a duplicate because you didn't explicitly mention JavaScript in the question.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f37261126%2fdependent-select-menus-in-html-and-javascript%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You would need cascading select fields to achieve the desired behavior. This can not be done purely in HTML, and you would need some programming logic in JavaScript to do it as you wish.



    The topic is explained in details in the following links:



    • How to populate a cascading Dropdown with JQuery

    • populate second dropdown based on selected value of first dropdown

    • How to populate second dropdown in $.ajax() depending on value of first dropdown?

    • Populate second select-dropdown based on choice of first select-dropdown and populate the external content below the radiobuttons

    • How does one make a cascading drop-down list in HTML with JavaScript?

    • Javascript Cascading Drop Down Menu With 4 Hierarchical Boxes

    Note: I didn't flag this question as a duplicate because you didn't explicitly mention JavaScript in the question.






    share|improve this answer





























      0














      You would need cascading select fields to achieve the desired behavior. This can not be done purely in HTML, and you would need some programming logic in JavaScript to do it as you wish.



      The topic is explained in details in the following links:



      • How to populate a cascading Dropdown with JQuery

      • populate second dropdown based on selected value of first dropdown

      • How to populate second dropdown in $.ajax() depending on value of first dropdown?

      • Populate second select-dropdown based on choice of first select-dropdown and populate the external content below the radiobuttons

      • How does one make a cascading drop-down list in HTML with JavaScript?

      • Javascript Cascading Drop Down Menu With 4 Hierarchical Boxes

      Note: I didn't flag this question as a duplicate because you didn't explicitly mention JavaScript in the question.






      share|improve this answer



























        0












        0








        0







        You would need cascading select fields to achieve the desired behavior. This can not be done purely in HTML, and you would need some programming logic in JavaScript to do it as you wish.



        The topic is explained in details in the following links:



        • How to populate a cascading Dropdown with JQuery

        • populate second dropdown based on selected value of first dropdown

        • How to populate second dropdown in $.ajax() depending on value of first dropdown?

        • Populate second select-dropdown based on choice of first select-dropdown and populate the external content below the radiobuttons

        • How does one make a cascading drop-down list in HTML with JavaScript?

        • Javascript Cascading Drop Down Menu With 4 Hierarchical Boxes

        Note: I didn't flag this question as a duplicate because you didn't explicitly mention JavaScript in the question.






        share|improve this answer















        You would need cascading select fields to achieve the desired behavior. This can not be done purely in HTML, and you would need some programming logic in JavaScript to do it as you wish.



        The topic is explained in details in the following links:



        • How to populate a cascading Dropdown with JQuery

        • populate second dropdown based on selected value of first dropdown

        • How to populate second dropdown in $.ajax() depending on value of first dropdown?

        • Populate second select-dropdown based on choice of first select-dropdown and populate the external content below the radiobuttons

        • How does one make a cascading drop-down list in HTML with JavaScript?

        • Javascript Cascading Drop Down Menu With 4 Hierarchical Boxes

        Note: I didn't flag this question as a duplicate because you didn't explicitly mention JavaScript in the question.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 23 '17 at 10:28









        Community

        11




        11










        answered May 16 '16 at 18:58









        Bruno ToffoloBruno Toffolo

        1,2711423




        1,2711423





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f37261126%2fdependent-select-menus-in-html-and-javascript%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript