I am displaying a modal after a button click . The code of button for opening a modal is as follows :
<button type="button" name="btnEditIP" data-toggle="modal" data-target="#myModal" class="sultan_btn">Edit IP</button>\
The code of modal is as follows :
<div id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<form id="ipForm" class="form-horizontal" role="form" method="post" action="info_edit.jsp">
<div class="modal-header modal-header-warning">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title ">Please Enter IP Address</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="inputName">IP Address</label>
<input type="text" class="form-control" name="ip"/>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" name="btnSave" id="btnSave" class="btn btn-primary" data-dismiss="modal">Save</button>
</div>
</form>
</div>
</div>
In edit_info.jsp page, I am trying to determine whether the btnSave button is pressed by the following code :
if ((request.getParameter("btnSave") == null) ? false : true) {
out.println("Form submitted");
}
else{
out.println("Form not submitted");
}
Although , I am pressing the Save button in modal , I am always getting this message , "Form not submitted!" .That means , either the form is not submitted or there is an error in pressing button .
I am not sure where is the error . I have tried a lot but could not identified where is the error . Please help me to solve this error .