Solved

Javascript: Change form action of form on Opener

Posted on 2004-10-19
4
1,100 Views
Last Modified: 2012-08-13
I'm terrible with Javascript, mainly because of the case-sensitivity, however, I'm now doing something that I have only done once or twice, but I can't remember exactly what syntax I used, so I'm not sure if I'm missing something or if I have a case-sensitive issue.

Here's what I have:


      <script language="javascript">
                  
            if EVAL(window.opener.document.frmAdd)
                     {
                  window.opener.frmAdd.action = "AddInstallation.asp?ptype=postback";
                  window.opener.frmAdd.Submit();
                   }
            else {
                  window.opener.frmEdit.action = "EditInstallation.asp?ptype=postback";
                  window.opener.frmEdit.Submit();                        
                          }
      </script>

What I'm trying to do is determine if a specific form exists on the opener (form that opened the popup) and if it exists, then change the action property of it, and submit the form.

Anyone see what I'm missing.

Thanks
-Anthony
0
Comment
Question by:ALaRiva
  • 2
  • 2
4 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 500 total points
ID: 12352294
Hi ALaRiva,

f=window.opener.document;
if (f.forms["frmAdd"]) {
   f.forms["frmAdd"].action="AddInstallation.asp?ptype=postback";
   f.forms["frmAdd"].submit();
} else {
   f.forms["frmEdit"].action="EditInstallation.asp?ptype=postback";
   f.forms["frmEdit"].submit();
}


Regards,
Zyloch
0
 
LVL 10

Author Comment

by:ALaRiva
ID: 12352492
Perfect Zyloch!   Thank You.

BTW - I posted a solution to that Flash File and DHTML Menu question you were involved in.  Just in case you don't come across it.

-Anthony
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12352500
Yeah I saw. What was that wmode thing anyways? I think that's a great solution that you got there :)
0
 
LVL 10

Author Comment

by:ALaRiva
ID: 12352519
It's the window mode of the flash file.  If you set it to Opaque it allows other objects (i.e. DHTML Menus) to be displayed above it.  Sort of getting around the Z-Index issue you mentioned.

There is also a way of saving the Flash File with an Opaque setting already defined, but I don't have Flash in front of me so I couldn't give direction on which menus to look at.

-Anthony
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now