Show A Second Select Box Based On The Option Chosen In The First? March 21, 2024 Post a Comment I have the following select drop down box: Please Select).change(function() { if (this.val()=='Interlink') { $('body').append(secondSelect); } else { $('#secondselectid').remove(); }); Copycustomise the html and where you want to append the second selectSolution 2: <script> $(function(){ $('#s1').hide(); }); functioncall() { var check=$('#s2').val(); if(check=="Interlink") { $('#s1').show(); } Copyelse { $('#s1').hide(); } } </script><selectname="selectcourier"requiredonchange="call();"id="s2" ><optionvalue="">Please Select</option><optionvalue="collection">Collection</option><optionvalue="Interlink">Interlink</option><optionvalue="DespatchBay">Despatch Bay</option><optionvalue="International">International</option></select><label>Select Shipping Courier:</label><selectname="selectcourier"requiredid="s1"><optionvalue="1">Please Select</option><optionvalue="2">Next Day</option><optionvalue="3">2-3 Day</option><optionvalue="3">Pre 12</option></select>CopyYou can use the above code to achieve your taskSolution 3: Just react on the event of changing the value of the first select.If the value equals 'Interlink' display the second select - if the value is something else hide the second select.<selectname="selectcourier"requiredonchange="document.getElementById('interlink_addition').style.display = (this.value=='Interlink' ? 'block' : 'none')"><optionvalue="">Please Select</option><optionvalue="collection">Collection</option><optionvalue="Interlink">Interlink</option><optionvalue="DespatchBay">Despatch Bay</option><optionvalue="International">International</option></select><divid="interlink_addition"style="display:none"><label>Select Shipping Courier:</label><selectname="selectcourier"required><optionvalue="1">Please Select</option><optionvalue="2">Next Day</option><optionvalue="3">2-3 Day</option><optionvalue="3">Pre 12</option></select></div>CopySolution 4: you can use ajax for this. write a ajax function to show second select box and call it on onChange event of the first select Box Share Post a Comment for "Show A Second Select Box Based On The Option Chosen In The First?" Top Question Firefox, Chrome, Safari Have Grey Background For Mp4 Html5 Video Any video (that I can make) with a white background becomes… Red Border Still Appears On Inputs After Resetting An HTML 5 Form Firefox I have an HTML 5 form! Great, I'm excited! I decide to … Svg Animation And Firefox I'm struggle with SVG animation drawing, which is work … Form To Iframe Submission - How Do You Reset The Form After File Upload? I have a form that submits the results to an iframe. The su… How To Hide/show Tabs Using Jquery I have four tabs.On loading only the first tab is opened an… How To Save Html5 Geolocation Data To Python Django Admin? Is it possible to save the javascript html5 geolocation lat… How To Limit The Html Table Records In Each Page I am populating a table in my jsp which has more than 20 re… How To Display A Python String As Html In Jupyter Notebook In IPython notebook, I used to be able to display a python … How To Add Placeholder Field? I've been trying to add placeholder in input type='… Bounce Animation On A Scaled Object What is the best way to have an object scale and then perfo…