Show A Second Select Box Based On The Option Chosen In The First? June 06, 2023 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 Display None If Null Using Data-id I have a menu which list items which display the the conten… Firefox, Chrome, Safari Have Grey Background For Mp4 Html5 Video Any video (that I can make) with a white background becomes… Html5 Audio, Web Audio Api, Cors And Firefox I have been trying to get this to run correctly so days now… Change Font Color And Background In Html On Mouseover I'm using a small piece of inline HTML code to change t… IE11 Textarea Loses Focus If Another Textarea Is Disabled In this fiddle, using ie11 with open Console, input somethi… Javascript. Onclick Returns Always The Same Object I have got 16 divs of the same class name in html document … Homepage Slow To Load When I go to the homepage of my website after clearing my c… Make Fully Visible One Element From Overflow:hidden Element Please check http://jsfiddle.net/mtN6R/9/ .tooltip{ col… 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 Limit The Html Table Records In Each Page I am populating a table in my jsp which has more than 20 re… December 2024 (1) November 2024 (39) October 2024 (50) September 2024 (16) August 2024 (209) July 2024 (195) June 2024 (406) May 2024 (689) April 2024 (442) March 2024 (874) February 2024 (958) January 2024 (843) December 2023 (878) November 2023 (384) October 2023 (614) September 2023 (277) August 2023 (316) July 2023 (254) June 2023 (346) May 2023 (200) April 2023 (144) March 2023 (135) February 2023 (172) January 2023 (255) December 2022 (136) November 2022 (215) October 2022 (181) September 2022 (161) August 2022 (293) July 2022 (87) Menu Halaman Statis Beranda © 2022 - Html5 School