Solved

Submit button in other frame

Posted on 1999-01-21
20
221 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
  • 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 
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 150 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Changing Two Areas of a Page 5 27
Hide un-named HTML Label with CSS 14 36
ability to create nested list on the UI using PHP, HTML, Javascript 7 45
CSS Style 8 20
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
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.…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

827 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