What you are looking for is the following bit of code. The second method
will select any text that is already in the textbox so that it will be
overwritten. This allows you to put something like "Enter SKU here ..." in
the textbox without requiring them to manually delete it before starting to
enter the SKU.

<html>
<head>
<script type="JavaScript">
function setFocus()
{
  document.myform.mytext.focus();
  document.myform.mytext.select();
}
</script>
</head>

<body onLoad="setFocus();">

....

</body>
</html>

Regards,

Steve

-----Original Message-----
From: John Fix 3rd [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 3:48 PM
To: CF-Talk
Subject: OT: Making a form text input box "active"


I'm working on a simple form page to lookup items based on a sku number.
There's a text input and a SUBMIT button.  The page is eventually going to
be used on a PC running IE in kiosk mode, and I want to eliminate the mouse.
I want the text input box to be active by default, so a user can just type a
sku number and press ENTER.

A real quick and dirty version of the page is at
http://www.cornells.com/storelink/item.cfm.

I did some quick browsing in some of my HTML references and can't find a way
to do this.  I haven't done much Javascript, but maybe there's a way to
solve this problem with JS? ANy suggestions would be appreciated.

Thanks!

John
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to