I am trying to make a condition to my select input ..
$(document).on("change", "#action", function () {
if(this.value !== "" ){
location = this.value;
}
});
but if the condition is false, it will just ignore and continue running the rest of the scripts ..
here's my remaining scripts:
$(document).on("click", "#delete_button", function () {
$("#delete_modal").modal("show");
});
$(document).on("click", "#logout_button", function () {
var url = $(this).data("url");
$("#logout_form").attr("action", url);
$("#logout_form").submit();
});
and here's my select;
<select id="action" class="form-control input-sm">
<option value="">Select</option>
<option value="/details/1">Details</option>
<option value="edit/1">Edit</option>
<option value="" data-url="/delete/1" id="delete_button">Delete</option>
<option value="" data-url="/logout/1" id="logout_button">Logout</option>
</select>
This code works in firefox and IE but doesn't work in chrome ..
How to fix this Problem??