Solved

Forms in frames

Posted on 2000-03-08
9
165 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Link a VBS to an HTA 6 38
CSS Logo Problem. 2 21
How can I increase the size of this logo 5 37
How to make a moving character 3 62
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

825 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