I want data from database conditionally in dropdownlist for example,if a drop-down contains 5 entries and if user selects an entry and click on submit button selected entry from drop-down should be should not be there in drop-down i.e. only 4 entries should be there.
What should i do? my dropdown is working properly.
If I understood right what U want to do, all u have to do is to add catch submit of form, and to remove selected element from dropdown.
Something like:
$(’#formID’).on(‘submit’ function(e) {
e.preventDefault();
var toRemove = $('#dropdownID option:selected');
$('#formID').submit();
toRemove.remove()
})
hope this can be useful to U.