<input type="button" value="Refer Candidate" class="formbtn" data-toggle="modal" data-target="#recruiterModal">
I want to call a jsp page through a button click using jquery.
<input type="button" value="Refer Candidate" class="formbtn" data-toggle="modal" data-target="#recruiterModal">
I want to call a jsp page through a button click using jquery.
You can use a form
tag which wraps the input
tag with type=submit
and in the form
's action
attribute you can specify the JSP page's link.
<form action='jsp-page-to-call.jsp'>
<input type="submit" value="Refer Candidate" class="formbtn" data-toggle="modal" data-target="#recruiterModal">
</form>
So on click of the Submit Button the request goes to the JSP Page.
Using JS
<form id="frmID">
<input type="submit" value="Refer Candidate" class="formbtn" data-toggle="modal" data-target="#recruiterModal">
</form>
On button click
document.getElementById("frmID").action="${pageContext.request.contextPath}/YourjspPage.jsp";
document.getElementById("frmID").submit();
<input id="buttonid" type="button" value="Refer Candidate" class="formbtn" data-toggle="modal" data-target="#recruiterModal">
$('#buttonid').click(function(){
window.open('yourJspPageHere.jsp','_blank');
});
is this what you're looking for?