i am trying to close modal window immediately after form is submitted. modal window consists of login form which updates data in php mysql. Everything is going fine except closing part:
<div id="register"><a data-toggle="modal" href="#RModal" class="btn btn-primary btn-lg">SIGN UP</a></div>
<!-- Modal -->
<h4 class="modal-title">REGISTRATION FORM</h4>
</div>
<div class="modal-body">
<div id="contact_form">
<form id="register-form" name="contact" action="">
<fieldset>
<div class="field_container"> Email:</label>
<input type="text" name="cust_email" id="email" maxlength="100" onblur="emvalidation()" style="width: 250px; height: 30px"; />
<div class="field_container">Password:</label>
<input type='password' name='cust_password' id='password' maxlength="12" onblur="pwordvalidation()" style="width: 250px; height: 30px"; />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<INPUT class="btn btn-primary" type="submit" name="submit" value="Register" >
</fieldset>
</form>
jquery to submit and process data:
$(document).ready(function(){
$("#register-form").submit(function(){
var str = $(this).serialize();
$.ajax(
{
type: "POST",
url: "register_process.php",
data: str,
success:function(result)
{
$(" #register .modal-body").load('login_succesful.php');
}
});
return false;
});
});
It doesnt get closed when submitted. (processing of data is happening). Also when session is set in php, content of ".message" doesnt appear automatically, but after a refresh.