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();                                    
                        }
ASP.NETASPJavaScript

Avatar of undefined
Last Comment
Devildib
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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Devildib
Devildib

ASKER

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
Avatar of BigRat
BigRat
Flag of France image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Devildib
Devildib

ASKER

It was some flag causing the issue.But your comments will surely help in future.
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo