I use this script to put the cursor into the First Form Window...
I suspect you can modify it to suit your needs.
<!--- USED TO PLACE FOCUS INTO FIRST FORM WINDOW --->
<script language='JavaScript' type='text/javascript'>
<!--
function firstFocus() {
if (document.forms.length > 0) {
for (j=0;j<document.forms.length;j++) {
var TForm = document.forms[j];
for (i=0;i<TForm.length;i++) {
if ((TForm.elements[i].type=='text')||
(TForm.elements[i].type=='textarea')||
(TForm.elements[i].type=='password')||
(TForm.elements[i].type.toString().charAt(0)=='s')) {
if (!(TForm.elements[i].readonly)&&
!(TForm.elements[i].disabled)) {
document.forms[j].elements[i].focus();
break;
}
}
}
}
}
}
-->
</script>
</head>
<body leftmargin="0" topmargin="0" onLoad="firstFocus();">
At 01:58 PM 8/9/02, you wrote:
>Hi all-
>
>I know that everyone steals their Javascripts from like one guy somewhere on
>the Internet (he's a busy guy, that Javascript programmer) so I'm wondering
>if he's on the list.
>
>I have this form that I need to be able to type in a text box, and have the
>form submit onkeyup, but when the form submits to itself, the cursor is
>placed in the text box at the end of the text already in it (a cfparam'd
>FORM field.) Basically I built a quick 'n' dirty narrow-down search
>populating a multi-select box from a CF query-of-queries with the parent
>query cached. Makes for a nice quick ND search. I've tried every
>javascript and custom tag version of an ND search I can find, but haven't
>found anything that does just what I want. What I've written works, but I
>have to keep selecting the text field each time the page loads, or at best
>can have the whole text selected or the cursor placed in the first position.
>I'd like to be able to place it AFTER the last character, if that's
>possible. I want to say that it's GOT to be possible, but Javascript and I
>only work together out of need. :)
>
>Anyone know how to do this? Alternatively, does anyone have a good CF
>narrow-down search which uses a LIKE %#variable#% where criteria to elminate
>all records that don't have the search criteria in them, and populate a
>multi-select box with the results?
>
>Thanks for your help, all...
>
>-Kevin
>
>
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists