I want to add style class to my submit button, like this I can use bootstrap Modal to show the result in this modal. This is my code :
@model pfebs0.Models.StatModel
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
...
<p>
<button type="submit" class="mybtn" >Get</button>
..
}
<div id="modalDiv" class="modal fade" >
<div class="modal-dialog"></div>
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
<script>
$(function () {
$.ajaxSetup({ cache: false });
$('.mybtn').click(function () {
$('.modal-dialog').load(this.href, function () {
$('#modalDiv').modal({
backdrop: 'static',
keyboard: true
}, 'show');
bindForm(this);
});
return false;
});
});
</script>
}
The problem when I add the class class="mybtn" my form is not submitted any more when I click on it, If I remove class="mybtn" the button works fine.
Also I have tried to use this : <input type="submit" value="Create" class="mybtn" /> but same problem