Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Why does putting focus on textbox also set focus to submit

Reply
Thread Tools

Why does putting focus on textbox also set focus to submit

 
 
jw56578@gmail.com
Guest
Posts: n/a
 
      06-01-2005
Is there a reason why setting focus to a textbox input, also gives
focus to a submit button on the page, to where if you click enter in
the text box, the submit button will be clicked.

 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      06-01-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> Is there a reason why setting focus to a textbox input, also gives
> focus to a submit button on the page, to where if you click enter in
> the text box, the submit button will be clicked.


So that with simple forms, such as:

Query: [ ] [Submit]

A user can type and press enter, rather then having to type, tab and press
enter or type the fiddle with the mouse. Its a time saver.

http://ppewww.ph.gla.ac.uk/~flavell/...mquestion.html

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      06-06-2005
(E-Mail Removed) wrote:

> Is there a reason why setting focus to a textbox input, also gives
> focus to a submit button on the page,


It does not, the focus stays on the input control. The only/first submit
button is often highlighted, though.

> to where if you click enter in the text box, the submit button will
> be clicked.


No, it will not. Instead, the form will be submitted, which is a different
thing. Check out the `onclick' handler of the submit button.


PointedEars
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is a button Click event also called when a textbox TextChanged event is called??? S_K ASP .Net 6 11-08-2007 07:44 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Re: UPDATE: They didn't only pledge allegiance to Mex flag: anchor babies in TX *also* shouted "RAZA! RAZA!" in US school also tedorn44@hotmail.com Digital Photography 9 10-21-2006 11:12 AM
Difference between putting code in constructor and putting code in static{} Saurabh Java 6 05-30-2004 02:44 PM



Advertisments