Created
August 29, 2017 09:27
-
-
Save philchanet/23ea4c41a3f1195981352ef03790d9bf to your computer and use it in GitHub Desktop.
Open modal upon selection of an option in a select - class-based version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select class="selectpicker actions-more" data-style="btn-default btn-xs" data-width="auto" data-container="body" title="Horse..."> | |
<option disabled>Substitute</option> | |
<option value="withdraw">Withdraw</option> | |
<option value="comment">Comment</option> | |
<option value="viewlog">View log</option> | |
</select> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.actions-more').change(function() { | |
var action = $(this).val(); | |
if(action == "withdraw"){ | |
$('#horseWithdraw').modal("show"); | |
} | |
else if(action == "substitute"){ | |
$('#horseSubstitute').modal("show"); | |
} | |
else if(action == "setHorsePriority"){ | |
$('#setHorsePriority').modal("show"); | |
} | |
else if(action == "viewlog"){ | |
$('#feiLogsShow').modal("show"); | |
} | |
else if(action == "comment"){ | |
$('#addComment').modal("show"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment