Solved

Forms in frames

Posted on 2000-03-08
9
157 Views
Last Modified: 2010-04-09
Hiya........
A web page that has 3 frames, "top", "choose" and "show_info".
there is a form inside "choose" called "readad", this has a text box called N"AMESTART".
When I hit enter after putting a value in "NAMESTART"  it targets another frameset into show_info that has two frames "view" and "buttons".
At this stage (once view has loaded), I want to put the focus into NAMESTART (back up a couple of levels) and reset it, so that its empty.
Thanks
0
Comment
Question by:rickyr
  • 6
  • 3
9 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 2597270
First of all, rename your top frame to something besides "top" since this is an HTML keyword.  I suggest "topframe".

Then, in one of the files that goes into either the view frame or the buttons frame, do this:

<BODY onLoad='top.choose.document.readad.NAMESTART.value="";top.choose.document.readad.NAMESTART.focus();'>

0
 
LVL 33

Expert Comment

by:knightEknight
ID: 2597274
.. BTW, I meant to say that "top" is a JavaScript keyword.
0
 
LVL 3

Author Comment

by:rickyr
ID: 2597555
I tried this, (I have actually been trying this all along) but the focus doesn't get set, nor does it get reset.

I am doing this successfully for the same frame while a different form is in there.
heeeeeelp
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 2597617
In that case I would put the above code in the BODY tag of both the view frame and the buttons frame.  You might also want to put the whole thing in a setTimeout to give it an extra few milliseconds:

<BODY onLoad=setTimeout('top.choose.document.readad.NAMESTART.value="";top.choose.document.readad.NAMESTART.focus();',100)>


both this code, and the code above assume that your frame is named "choose", ie  <FRAME name="choose"

check also the name of your form and your textbox -- remember, these are all case-sensitive.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 33

Expert Comment

by:knightEknight
ID: 2597625
... could also be a simple HTML error, like a form within a form, or something wierd like that might cause this problem.
0
 
LVL 3

Author Comment

by:rickyr
ID: 2597723
Looks OK!
Could it be that I made a mistake about the levels in the frameset. Is there a way tp explicitly set it to the choose frame regardless of what frameset its nested in.
regards
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 2597855
Assuming that "choose" is one of your top level frames, then top.choose should work.  You could try parent.choose
Are you getting any error messages?  

Try this for debugging purposes:

<BODY onLoad='alert(self.name+" loaded");top.choose.document.readad.NAMESTART.value="";top.choose.document.readad.NAMESTART.focus();'>
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 50 total points
ID: 2597857
________________________________________________________________________________________________________________________
0
 
LVL 3

Author Comment

by:rickyr
ID: 2611877
ta
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now