How To Pass A Php Variable From A Dropdown To Another Dropdown Using Php? October 06, 2023 Post a Comment ).on("change", function(){ var selectedClass = $(this).val(); //store the selected value $('#select2').val(""); //clear the second dropdown selected value//now loop through the 2nd dropdown, hide the unwanted options $('#select2 option').each(function () { var newValue = $(this).attr('class'); if (selectedClass != newValue && selectedClass != "") { $(this).hide(); } else{$(this).show(); } }); }); });Copy<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script><selectid="select1"><optionvalue=""></option><optionvalue="number1">number 1</option><optionvalue="number2">number 2</option></select><selectid="select2"><optionclass=""></option><optionclass="number1">number 1.1</option><optionclass="number2">number 2.1</option><optionclass="number1">number 1.2</option><optionclass="number2">number 2.3</option><optionclass="number1">number 1.3</option><optionclass="number1">number 1.2</option></select>Copy Share You may like these postsWarning: Ocifetch() [function.ocifetch]: Ora-24374: Define Not Done Before Fetch Or Execute And FetchHow To Properly Escape A String Via Php And MysqlDatabase Connection To Live SiteHow To Insert Html Into Database Using Php
Post a Comment for "How To Pass A Php Variable From A Dropdown To Another Dropdown Using Php?"