We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anybody with an example on how to use sweet-alert to display a select input?
The text was updated successfully, but these errors were encountered:
I used this code:
<!-- SweetAlert input select hack--> <style> div.sweet-alert div.form-group input.form-control[placeholder="hidden"] { display: none; } </style> <script> swal({ title: "Alert with select", text: '<p">Select something</p>' + '<select class="sweet-select">' + ' <option value=""></option>' + ' <option value="1">one</option>' + ' <option value="2">two</option>' + ' <option value="3">three</option>' + '</select>', type: "input", html: true, inputPlaceholder: 'hidden', showCancelButton: true, closeOnConfirm: false }, function (inputValue) { if (inputValue === false) return false; if (inputValue === "") { swal.showInputError("You need to select something!"); return false } swal("It works!", 'Your selected: ' + inputValue, "success"); }); //SweetAlert input select hack $('body').on('change', '.sweet-select', function () { $(this).closest('.sweet-alert') .find('div.form-group input.form-control[placeholder="hidden"]') .val($(this).val()); }); </script>
Sorry, something went wrong.
No branches or pull requests
Anybody with an example on how to use sweet-alert to display a select input?
The text was updated successfully, but these errors were encountered: