Re: Making a form text input box active

2001-02-02 Thread David E. Crawford

in the onload event of the form put "document.formname.fieldname.focus();",
which will force the field to be "active" when the document is loaded.

DC

- Original Message -
From: "John Fix 3rd" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Friday, February 02, 2001 15:48
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Making a form text input box active

2001-02-02 Thread Scott Weikert

I think you can use the 'focus' bit of Javascript... perhaps in your BODY
tag, put in

onLoad='document.formname.fieldname.focus();'

Don't quote me on syntax there though :)

--Scott

- Original Message -
From: "John Fix 3rd" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Friday, February 02, 2001 1:48 PM
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Making a form text input box active

2001-02-02 Thread Kevin Queen

Try setting the tab-order to 0 for IE, or add a set focus to the form item
in the on-load.

-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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Making a form text input box active

2001-02-02 Thread Aaron Johnson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi John,

Real easy:

html
head
script
!--
function setfocus() {
document.yourform.yourinput.focus();
}
// --
/script
/head

body onLoad=setfocus()

form action="" method=get name=yourform

input type=text value="" name="yourinput"

/form


Going with Dave Watts mentioning today that the best answer to any
question is to try it for yourself, another way to do things... look
at how others do it, especially in regards to JS or HTML issues.  You
can find the above script by looking at googles' site or ton's of
others.

HTH's.

Aaron Johnson, MCSE, MCP+I
Allaire Certified ColdFusion Developer
MINDSEYE, Inc.
phn617.350.0339
fax617.350.8884
icq66172567
[EMAIL PROTECTED]
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Making a form text input box active

2001-02-02 Thread Scott Brader

John,

The script below will do just what you're looking for.

head-
script language=javascript type="text/javascript"
!--
function onBodyLoad() {
document.formname.fieldname.focus();

}
// --
/script
/head

body onload="onBodyLoad()"

Scott Brader
Prairie Software Development LLC
101 East Sadd Street
PO Box 235
North Prairie, WI 53153-0235

Phone: 262.392.9173
Fax: 262.392.9174

Toll Free: 888.821.3427
Mobile: 262.490.1376

Amateurs practice until they get it right,
Experts practice until they can't get it wrong.

-Original Message-
From: John Fix 3rd [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 2: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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Making a form text input box active

2001-02-02 Thread Steve Bernard

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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Making a form text input box active

2001-02-02 Thread John Fix 3rd

Scott,

That's the ticket!

I started to experiment with the 'element.focus' method but I was trying it within the 
FORM tags and it didn't work.  Placing it in the BODY tag solved the puzzle... 
thanks!

John

-Original Message-
From: Scott Weikert [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 4:01 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Making a form text input box "active"


I think you can use the 'focus' bit of Javascript... perhaps in your BODY tag, put in

onLoad='document.formname.fieldname.focus();'

Don't quote me on syntax there though :)

--Scott

- Original Message -
From: "John Fix 3rd" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Friday, February 02, 2001 1:48 PM
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists