Reputation: 671
I want to show popup when I click the submit button on view page in mvc3. I think it can be done by passing class but I am unable to get the pop up even doing so. Please explain how can I show popup in button click using jquery?
Upvotes: 2
Views: 1026
Reputation: 5464
If you are using a submit button then you should use the form submit event rather than on submit button click.
If you are using a simple input type button then you can use click event to show popup.
The third case if you want to use submit button then make your form as ajax form. and use beforeSend function to show the popup.
As currently I am using Colorbox popup, so you can use the following syntax to show popup:
$.colorbox.open();
Upvotes: 0
Reputation: 3870
This should work just fine
<script type="text/javascript">
$(function () {
$(".your-button-class").click(function() {
// do popup
});
});
</script>
Upvotes: 0