?
Solved

Submit button in other frame

Posted on 1999-01-21
20
Medium Priority
?
226 Views
Last Modified: 2010-04-09
I have two frames: Up and Down
In the upper one there is an asp page that consist in a form with a submit button.
What I want is to move the submit button to the other frame.
Can I do it ? ? ? How can I ? ? ?
Thanks
0
Comment
Question by:carflores
[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
  • 11
  • 6
  • 2
  • +1
20 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1845560
<FORM>
<INPUT TYPE="BUTTON" VALUE="Submit" onClick="parent.Up.forms[0].submit()">
</FORM>

Martin
0
 
LVL 6

Expert Comment

by:PBall
ID: 1845561
And that didn't work?


0
 
LVL 6

Expert Comment

by:PBall
ID: 1845562
oops..hehe..i thought martin's comment was still the question.

that should work :)
0
WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

 
LVL 4

Expert Comment

by:martinag
ID: 1845563
No it shouldn't :-)
It should be
  parent.Up.document.forms[0].submit()

Martin
0
 
LVL 6

Expert Comment

by:PBall
ID: 1845564
Hey, what is that? a trick comment? hehehe.
well, don't do frame much meself.  Show you how much I know about the frame thingy. :)
0
 

Author Comment

by:carflores
ID: 1845565
Thanks Guys, but it doesn't work for me. Maybe I miss something.
With IE4, an error appears: 'parent.up.document' is not an object.
With Netscape 4 nothing happened
There are really 4 frames.
Here is what i Have:

<form>
<img src="images/botonhelp.jpg">  
<img src="images/botondemo.jpg"
<img src="images/botonhome.jpg" >
<input TYPE="image" src="images/botonprocess.jpg" name="process" onClick="parent.up.document.forms[3].submit()">
</form>
0
 

Author Comment

by:carflores
ID: 1845566
Thanks Guys, but it doesn't work for me. Maybe I miss something.
With IE4, an error appears: 'parent.up.document' is not an object.
With Netscape 4 nothing happened
There are really 4 frames.
Here is what i Have:

<form>
<img src="images/botonhelp.jpg">  
<img src="images/botondemo.jpg"
<img src="images/botonhome.jpg" >
<input TYPE="image" src="images/botonprocess.jpg" name="process" onClick="parent.up.document.forms[3].submit()">
</form>
0
 

Author Comment

by:carflores
ID: 1845567
Thanks Guys, but it doesn't work for me. Maybe I miss something.
With IE4, an error appears: 'parent.up.document' is not an object.
With Netscape 4 nothing happened
There are really 4 frames.
Here is what i Have:

<form>
<img src="images/botonhelp.jpg">  
<img src="images/botondemo.jpg"
<img src="images/botonhome.jpg" >
<input TYPE="image" src="images/botonprocess.jpg" name="process" onClick="parent.up.document.forms[3].submit()">
</form>
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 1845568
Are you sure you are typing the frame name correctly (its case sensitive)

instead of parent try top maybe (though I don't think it should work) but ya
never know :)

CJ
0
 

Author Comment

by:carflores
ID: 1845569
Yes...
I didn´t type the frame name correctly .
Now it´s working, but not at all, because I had an onSubmit event in the frame where the form is and this event is not responding anymore....
0
 
LVL 6

Expert Comment

by:PBall
ID: 1845570
Once you called a form submit method directly from a script, the onSubmit event will not be triggered.

Your only solution is to create another function like:

in the page with the form:

function isAllValid()
{
  //this is your onSubmit event handler (i.e. for validation checkings.
}

function submitForm()
{
  if (isAllValid())
    document.form_name.submit();
}

<form name=form_name action=.... method=... onSubmit="return isAllValid()">

Follow Me?

Now, in the other frame, wire the button/link/image, whatever it is like so:
<input type=button value='Submit' onClick='parent.frame_name.document.submitForm()'>

to call the submitForm function.  This way, you still get to run your validation routine and the form will only submit when it is validated.
0
 

Author Comment

by:carflores
ID: 1845571
An error appears:
"Object doesn't support this property or method"

And did what you told me.....

in the frame called doc:

function validarvalores() {
  // for validation checkings.
}

function entrarforma() {
      if (validarvalores())
            document.frmForma.Submit();
}

<FORM NAME="frmForma" METHOD="post" ACTION="trancuentasresp.asp" onSubmit="return validarvalores()">


in the other frame called barra:
<form>
<img src="images/botonhelp.jpg" WIDTH="111" HEIGHT="19">&nbsp;&nbsp;
<img src="images/botondemo.jpg" WIDTH="111" HEIGHT="19">&nbsp;&nbsp;
<img src="images/botonhome.jpg" WIDTH="111" HEIGHT="19">&nbsp;&nbsp;
<input TYPE="image" src="images/botonprocess.jpg" name="process" onClick="parent.doc.document.entrarforma()" WIDTH="131" HEIGHT="19">
</form>
0
 

Author Comment

by:carflores
ID: 1845572
An error appears:
"Object doesn't support this property or method"

And did what you told me.....

in the frame called doc:

function validarvalores() {
  // for validation checkings.
}

function entrarforma() {
      if (validarvalores())
            document.frmForma.Submit();
}

<FORM NAME="frmForma" METHOD="post" ACTION="trancuentasresp.asp" onSubmit="return validarvalores()">


in the other frame called barra:
<form>
<img src="images/botonhelp.jpg" WIDTH="111" HEIGHT="19">&nbsp;&nbsp;
<img src="images/botondemo.jpg" WIDTH="111" HEIGHT="19">&nbsp;&nbsp;
<img src="images/botonhome.jpg" WIDTH="111" HEIGHT="19">&nbsp;&nbsp;
<input TYPE="image" src="images/botonprocess.jpg" name="process" onClick="parent.doc.document.entrarforma()" WIDTH="131" HEIGHT="19">
</form>
0
 

Author Comment

by:carflores
ID: 1845573
An error appears:
"Object doesn't support this property or method"

And did what you told me.....

in the frame called doc:

function validarvalores() {
  // for validation checkings.
}

function entrarforma() {
      if (validarvalores())
            document.frmForma.Submit();
}

<FORM NAME="frmForma" METHOD="post" ACTION="trancuentasresp.asp" onSubmit="return validarvalores()">


in the other frame called barra:
<form>
<img src="images/botonhelp.jpg" WIDTH="111" HEIGHT="19">&nbsp;&nbsp;
<img src="images/botondemo.jpg" WIDTH="111" HEIGHT="19">&nbsp;&nbsp;
<img src="images/botonhome.jpg" WIDTH="111" HEIGHT="19">&nbsp;&nbsp;
<input TYPE="image" src="images/botonprocess.jpg" name="process" onClick="parent.doc.document.entrarforma()" WIDTH="131" HEIGHT="19">
</form>
0
 

Author Comment

by:carflores
ID: 1845574
Oops...

Every time I do a reload of the page, without knowing, I'm inserting the comment again...

I'm sorry........

0
 
LVL 6

Expert Comment

by:PBall
ID: 1845575
My frame stuffs kinda sucks, you might want to try just...
parent.doc.entrarforma() on that INPUT TYPE="image" line.

that might do it.

0
 

Author Comment

by:carflores
ID: 1845576
Yes PBall...
Now it's working, but only with IE4. With Netscape nothing happend.
And I thought that with Netscape was going to be more compatible...
Dou you know why ? ? ?
And when are you goin to answer formally the question ? ? ? So I can grant you for all the help you have giving me.....
Thanks...
0
 
LVL 6

Accepted Solution

by:
PBall earned 600 total points
ID: 1845577
Netscape was gpomg to be more compatible..hehe.
Not clear there.  In netscape you might need that
parent.doc.document.entraforma() instead of just parent.doc.entraforma()

if that's the case, you need to do some browser sniffing before actually calling one method or the other.

ns = navigator.userAgent... I forgot how to sniff browser the old way, most of the time i just do:

ns = (document.layers) ? 1 : 0;
ie = (document.all) ? 1 : 0;

but the two lines above only work on 4.0 browsers, please check on paq in javascript section on browser sniffing or at builder.com, superscripter column, you should find this there.

if (ns)
  parent.doc.document.entraforma();
else
  parent.doc.entraforma();

anyhow..., claiming point.

0
 

Author Comment

by:carflores
ID: 1845578
Thanks again....
0
 

Author Comment

by:carflores
ID: 1845579
It seems like Netscape doesn't recognize the onClick event of the image...
Is it possible? ? ?
0

Featured Post

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

777 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