Solved

Keeping a frame active and its text box active.

Posted on 2000-02-29
13
188 Views
Last Modified: 2010-04-09
Hi....
I have  a number of frames the main one has a submmit and a textbox, I wish to keep the frame with the submit button
active, and the cursor in the text box, so my users can type a number, hit enter, wait for the update, then type another number, hit enter, and so on.
regards.
0
Comment
Question by:rickyr
13 Comments
 

Expert Comment

by:netzdrache
ID: 2568590
try this:

in the form tag:

onsubmit="document.yourform.yourinputfield.focus();"



0
 
LVL 8

Expert Comment

by:jbirk
ID: 2568753
That may have problems... I'm not sure.
If it does, you could add that line (document.yourform.yourinputfield.focus()) at the beginning of the new document which is loaded.

-Josh
0
 
LVL 4

Expert Comment

by:FRehman
ID: 2571694
this can bedone only in ie but in netscape there is no by default submit
here in ie if you press enter in the field it will submit the form
0
 

Expert Comment

by:xyzffff
ID: 2572197
point the "action" of form to its own.
0
 
LVL 8

Expert Comment

by:jbirk
ID: 2572433
if there is only one text field, enter will still submit the form on both IE and NN.  IF you have more stuff, then a little javascript can be used to capture the enter key.

-Josh
0
 
LVL 3

Author Comment

by:rickyr
ID: 2576655
Doesn't work!
I want the text area to to empty itself, and have the cursor in it, after it has submitted itself.
This is happening in a frame.
I'm sure this is a simple thing to do!

put this at the begining?????????
(document.yourform.yourinputfield.focus())
please be more specific.

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

Author Comment

by:rickyr
ID: 2576763
Or lets try it a different way.
I click an existing  href in frame 2, it does its thing.
When or as or before the page is loaded, a text area in another frame gets erased, and focused.
regards
0
 
LVL 8

Expert Comment

by:jbirk
ID: 2577110
What I mean by the beginning is put this between the <HEAD> tags:
<SCRIPT language="JavaScript">
<!--
top.framename.document.yourform.yourinputfield.focus();
// -->
</SCRIPT>

Be sure to replace framename with the name of the frame that contains the text field, yourforn with the name of the formm and yourinputfield with the name of the input field to focus on.

-Josh
0
 
LVL 3

Author Comment

by:rickyr
ID: 2577341
I put it in the head part of the frame that gets called, but the focus does NOT go to the frame I want. heres the source......
----------------------------------------------------
<HTML>
<HEAD>
<TITLE>Element Book to Team Advert 17553225-DD-2000</TITLE>
<script language="javascript">
(top.choose.document.myform.NAMESTART.focus())
</script>
</HEAD>
<BODY BGCOLOR="white" TEXT="black" LINK="red" ALINK="blue" VLINK="red">
<FORM>
<CENTER>
----------------------------------------------------
heres the other frame.........
<HTML>
<HEAD>
<title>Assign to Team: AnyMedia web page</title>
<script language="javascript">
function accomplishthis(form)
{
parent.choose.writeln(myform.NAMESTART.value)
parent.main2.location.href="find"
parent.myform.NAMESTART.value=""
}
</script>
</HEAD>
<Body bgcolor=white>
<form name=myform method="GET" action="/assign/find" target="main2" onsubmit="document.myform.NAMESTART.focus();">
Assign Advert
<INPUT TYPE="text" NAME="NAMESTART" SIZE=20>
----------------------------------------------------
heres the calling frameset.......
<frameset rows="40,*" border="10" bordercolor="#FFFFFF">
<frame src="head.htm" name="head" noresize scrolling=no marginheight="10" marginwidth="10">
<frameset cols="150,*" border="10" bordercolor="#FFFFFF">
<frame src="prod1.htm" name="prod" noresize scrolling=no marginheight="10" marginwidth="10">
<frame src="start.htm" name="main" noresize marginheight="10" marginwidth="10">
</frameset>
</frameset>
thanks
0
 
LVL 8

Expert Comment

by:jbirk
ID: 2578585
You write top.choose.document...  where is frame 'choose'?  I see only head, prod, and main in your frameset.

-Josh
0
 
LVL 3

Author Comment

by:rickyr
ID: 2579433
prod1.html.........
<HTML>
<HEAD>
<TITLE>Anymedia Menu Frame</TITLE>
</HEAD>
<BODY bgcolor=#EE9910>

<A HREF="/readad/readad_fr.cis" target="main"><IMG SRC=/images/readad.gif border
=no></A><BR>
<A HREF="/newad/newad1.cis" target="main"><IMG SRC=/images/newad.gif border=no><
/A><BR>
<A HREF="/assign/assign_fr.cis" target="main"><IMG SRC=/images/assign.gif border
=no></A><BR>
<A HREF="/reject/reject_fr.cis" target="main"><IMG SRC=/images/reject.gif border
=no></A><BR>
<A HREF="/admin/admin1.cis" target="main"><IMG SRC=/images/admin.gif border=no><
/A><BR>
<A HREF="/prod2.htm">Web Two</A><BR>
</BODY>
</HTML>
~        


 loads the following into main2 (another frameset).......
<HTML>
<head>
<title>AdEntry frame</title>
</head>

<frameset cols="200,*" border="1" bordercolor="#FFFFFF">
<frame src="/readad/readad_top.cis" name="choose" noresize scrolling=no marginhe
ight="10" marginwidth="10">
<frame src="/readad/empty.cis" name="main2" noresize marginheight="10" marginwid
th="10">
</frameset>

</HTML>

0
 
LVL 8

Accepted Solution

by:
jbirk earned 50 total points
ID: 2579816
Then to access it you need to go through main.  Like this:
top.main.choose.document.myform.NAMESTART.focus()  Or if it's from main2 that this call is being made, you can do this:
parent.choose.document.myform.NAMESTART.focus()
Parent just goes up one level in the frame nesting, whereas top always goes to the first frameset.

-Josh
0
 
LVL 3

Author Comment

by:rickyr
ID: 2601761
You are a STAR!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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 style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

757 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

19 Experts available now in Live!

Get 1:1 Help Now