rickyr
asked on
Keeping a frame active and its text box active.
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.
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.
That may have problems... I'm not sure.
If it does, you could add that line (document.yourform.yourinp utfield.fo cus()) at the beginning of the new document which is loaded.
-Josh
If it does, you could add that line (document.yourform.yourinp
-Josh
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
here in ie if you press enter in the field it will submit the form
point the "action" of form to its own.
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
-Josh
ASKER
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.yourinp utfield.fo cus())
please be more specific.
regards
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.yourinp
please be more specific.
regards
ASKER
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
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
What I mean by the beginning is put this between the <HEAD> tags:
<SCRIPT language="JavaScript">
<!--
top.framename.document.you rform.your inputfield .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
<SCRIPT language="JavaScript">
<!--
top.framename.document.you
// -->
</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
ASKER
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.myfor m.NAMESTAR T.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(myfo rm.NAMESTA RT.value)
parent.main2.location.href ="find"
parent.myform.NAMESTART.va lue=""
}
</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
--------------------------
<HTML>
<HEAD>
<TITLE>Element Book to Team Advert 17553225-DD-2000</TITLE>
<script language="javascript">
(top.choose.document.myfor
</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(myfo
parent.main2.location.href
parent.myform.NAMESTART.va
}
</script>
</HEAD>
<Body bgcolor=white>
<form name=myform method="GET" action="/assign/find" target="main2" onsubmit="document.myform.
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
You write top.choose.document... where is frame 'choose'? I see only head, prod, and main in your frameset.
-Josh
-Josh
ASKER
prod1.html.........
<HTML>
<HEAD>
<TITLE>Anymedia Menu Frame</TITLE>
</HEAD>
<BODY bgcolor=#EE9910>
<A HREF="/readad/readad_fr.ci s" 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.ci s" target="main"><IMG SRC=/images/assign.gif border
=no></A><BR>
<A HREF="/reject/reject_fr.ci s" 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.ci s" 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>
<HTML>
<HEAD>
<TITLE>Anymedia Menu Frame</TITLE>
</HEAD>
<BODY bgcolor=#EE9910>
<A HREF="/readad/readad_fr.ci
=no></A><BR>
<A HREF="/newad/newad1.cis" target="main"><IMG SRC=/images/newad.gif border=no><
/A><BR>
<A HREF="/assign/assign_fr.ci
=no></A><BR>
<A HREF="/reject/reject_fr.ci
=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.ci
ight="10" marginwidth="10">
<frame src="/readad/empty.cis" name="main2" noresize marginheight="10" marginwid
th="10">
</frameset>
</HTML>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You are a STAR!
in the form tag:
onsubmit="document.yourfor