Solved

Forms in frames

Posted on 2000-03-08
9
147 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
Comment Utility
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
Comment Utility
.. BTW, I meant to say that "top" is a JavaScript keyword.
0
 
LVL 3

Author Comment

by:rickyr
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
... 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
Comment Utility
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
Comment Utility
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
Comment Utility
________________________________________________________________________________________________________________________
0
 
LVL 3

Author Comment

by:rickyr
Comment Utility
ta
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

763 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

9 Experts available now in Live!

Get 1:1 Help Now