Solved

Forms in frames

Posted on 2000-03-08
9
175 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
[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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
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?
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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)

726 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