Solved

Javascript: Change form action of form on Opener

Posted on 2004-10-19
4
1,104 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery Datatables.js Selecting a Row to get ID 5 37
Accordion won't close correctly 5 14
Duplicate Elements with JS / jQuery 3 24
Put POST values into cookies. 14 34
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

733 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