473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

textfield focus question

I have a text input field with a onChange javascript method.

I want to type text into the field and hit the return key and have my
javascript code executed. As is,
I have to click the mouse somewhere outside the input text field -
workable but cumbersome.

Any ideas?
Thanks,

Joe
Jul 23 '05 #1
1 1132
In article <24**************************@posting.google.com >, jo*@via.net
enlightened us with...
I have a text input field with a onChange javascript method.

I want to type text into the field and hit the return key and have my
javascript code executed.


But is this what your users want?
Changing the way a form works is very often a very bad idea. The "return"
key, or the "enter" key, has certain default behaviors that users get used
to.

Assuming it is agreeable to the users (intranet app, personal app, etc),
you'd need to capture the enter keypress and call your code. The code for
this has been posted several times. Google the usenet archive.
Note that this may break the default behavior of having a form submit when
the user presses the enter key, something some of us really, really like. ;)

HTH
--
--
~kaeli~
Why did kamikaze pilots wear helmets?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: C. Armour | last post by:
Help me, I'm suffering! Situation: I have a load() function which loads a bunch of TextFields with values. There are TextListeners registered for each of these TextFields. Thus, changing the...
1
by: Veverita | last post by:
Hi there I'm hoping that someone can help me with a question I have about javascript syntax. I got an html page that uploads an image and some text field to a database. What I'd like to do...
2
by: Ed | last post by:
Hi, I'm stuck at the moment trying to work out how to access the value of a textfield which gets added in a DIV element. I have functions to add and remove the textfields from the elements as...
1
by: platostoteles | last post by:
Hallo NG, I am new to JavaScript and would really appreciate any help to solve my problem. I am using the blow code in my form to validate form fields. What I would like to accomplish is that...
1
by: anna_john | last post by:
<html> <body> <form method="POST" name="f1"> <input type="text" name="t1" onchange="validate(this.value)" > <input type="text" name="t2" onchange="validate(this.value)"> </form>
1
by: paulsson | last post by:
Does anyone know why placing the cursor/focus in a textfield in IE would cause the window.onblur event handler to be called? This seems very odd since the window still has focus.... Is there a way...
2
by: Rex | last post by:
I have a main form and a subform. The main form has a combo box control and the subform has a textfield. What I want to do is when the main form loads it should check the value of the combo box...
1
by: lijiunni | last post by:
how will i validate textfield in jsp using javascript..........and also i have to set focus back to textfield if the validation result is wrong......i need an example coding
22
by: printline | last post by:
Hello All I have a script where i need to show the value of a text field in another textfield/field. I have done the same with my radio buttons and select fields like this: <script...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.