Solved

Javascript: Change form action of form on Opener

Posted on 2004-10-19
4
1,101 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Javasctipt 2 26
Html5 Index on a table 7 27
Javascript_Set_dropdown_value 7 34
insert a falling animation of heart  in php 4 23
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

803 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