Welcome Guest, Not a member yet? Register   Sign In
DropDown With Onchange Event
#3

(05-07-2018, 05:49 PM)shurimano Wrote: I want to ask about if i want make dropdown with onchange event, so basically for every diferent option in dropdown value it will show diferent data, anyone can help me with the basic code?

Hi here is a simple implementation in jQuery

PHP Code:
<script>
 $(
"#dropdownUL").change(function () {

var 
valueSelected = $("#dropdownUL :selected").val();

// Do something

switch (valueSelected) {
 
   case "new":
 
       $('#newDiv').addClass('show');
 
       break;
 
   case 'new2':
 
        $('#newDiv2').addClass('show');
 
       break;
}


});
</
script
Reply


Messages In This Thread
DropDown With Onchange Event - by shurimano - 05-07-2018, 05:49 PM
RE: DropDown With Onchange Event - by shahnewaz - 05-08-2018, 02:33 AM
RE: DropDown With Onchange Event - by qury - 05-08-2018, 03:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB