Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Submit button in other frame

Posted on 1999-01-21
20
Medium Priority
?
227 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This article discusses four methods for overlaying images in a container on a web page
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
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…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

618 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