Strange behaviour on Safari when trying to submit form using iframe
Hi All,
Not sure if this is the correct forum to raise this question
I am using iframe based mechanism to submit my login from and it is working fine on each and every browser except Safari.Here is the HTML form I am using to submit the information
<iframe height="0" width="0" name="loginFrame" hidden="true"> </iframe>
<form:form action="${loginActionUrl}" method="post" commandName="loginForm" id="header-signin" target="loginFrame" name="header-signin">
<input type="text" name="j_username" id="header-signin_j_username">
<input type="password" name="j_password" id="header-signin_j_password">
<input type="button" class="btn1" value="Sign In" id="login" formnovalidate="formnovalidate"/>
</form:form>
and here is the java-script code
$(document).ready(function(){
$("#login").live('click',function(e) {
if(validateSigninForm('header-signin')){
$("#header-signin").submit();
}
});
});
there are some additional JS code which is being used
if($('#header-signin_j_password').length){
document.getElementById('header-signin_j_password').onkeydown = function(event) {
if (event.keyCode == 13) {
triggerSigin(this.form.id);
}
}
}
triggerSignin is simple using Jquery submit method to submit the form.
When I fill the password filed and press the enter button, everything is working fine and page is getting refreshed with the help of the iFrame, but if I click on the sing in button, Safari is opening a new browser window and sending null values to the back end server.
This behavior is only noticeable for the first time and if I click on the signin button second time, It will be working perfectly fine till I close the browser and open it again.
I am not sure what is going wrong here and this approach is working fine on all other browsers.
Can any one help me in this?
Safari browser-OTHER, Windows 7