Link to home
Start Free TrialLog in
Avatar of Devildib
Devildib

asked on

IE 11 issue form getting submitted twice

Hi Experts, I am working on a website written in  classic asp and .net.
There is a particular code snippet which needed a change.The flow is from a modaldialog popup which is an .asp page to another intermediate(without UI) .asp page for this change.No, aspx involved. AFter the change, on debugging via F12 developer tools, I see that for some reason, on IE button click, the code snippet fires twice while on firefox all is good.There is a single post seen for firefox.Below is my code snippet :Please Help.

if (window.opener== null)      {      
                                          
                                    window.dialogArguments.form1.action = "/includes/test.asp?page=somedotnetpage&id="+window.dialogArguments.form1.HidclientID.value;
                                    
                                    window.dialogArguments.form1.PIN.value = document.form1.pin.value;
                                    window.dialogArguments.form1.submit();
                        }
                        else {                                          
                                  window.opener.document.getElementById("form1").action = "/includes/test.asp?page=somedotnetpage&id="+opener.document.getElementById("HidclientID").value;
                                window.opener.document.getElementById("PIN").value = document.getElementById('pin').value;
                                                                              
                                    window.opener.document.getElementById("form1").submit();                                    
                        }
Avatar of Devildib
Devildib

ASKER

The button submit is written as :

<input type="button" id="btnSubmit" name="btnSubmit"  value="Submit" onclick="myfunction();"/>
ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I tried using return false but it did not work.Will changing type to submit and then using return false on top of it make any difference?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It was some flag causing the issue.But your comments will surely help in future.