By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,960 Members | 1,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,960 IT Pros & Developers. It's quick & easy.

Forms question

P: n/a
Is there a way to disable the submit functionality built into a text
box, or to redirect it into calling a javascript function without
submitting?
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article <bn*************@ID-174912.news.uni-berlin.de>,
la****@hotmail.com says...
Is there a way to disable the submit functionality built into a text
box, or to redirect it into calling a javascript function without
submitting?


Text boxes don't have submit functionality. What are you trying to do?

--
Hywel I do not eat quiche
http://hyweljenkins.co.uk/
http://hyweljenkins.co.uk/mfaq.php
Jul 20 '05 #2

P: n/a
In article <bn*************@ID-174912.news.uni-berlin.de>,
la****@hotmail.com enlightened us with...
Is there a way to disable the submit functionality built into a text
box, or to redirect it into calling a javascript function without
submitting?


If you mean you'd prefer the browser not do the default action of
submitting a form when the enter key is pressed, you can capture the
enter key and do something else. The code has been posted here several
times. Check the archives (google has nice archives at
http://groups.google.com).

It's not recommended, though. It basically breaks what the user is used
to - which can have implications with disabled people with special
browsers, too. It also irritates the hell out of people who are used to
their browsers doing something, then it doesn't. If this is for an
intranet application, CD-ROM, or game, disregard that. :)
-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #3

P: n/a
kaeli hu kiteb:
In article <bn*************@ID-174912.news.uni-berlin.de>,
la****@hotmail.com enlightened us with...
Is there a way to disable the submit functionality built into a text
box, or to redirect it into calling a javascript function without
submitting?

If you mean you'd prefer the browser not do the default action of
submitting a form when the enter key is pressed, you can capture the
enter key and do something else. The code has been posted here several
times. Check the archives (google has nice archives at
http://groups.google.com).

It's not recommended, though. It basically breaks what the user is
used to - which can have implications with disabled people with
special browsers, too. It also irritates the hell out of people who
are used to their browsers doing something, then it doesn't. If this
is for an intranet application, CD-ROM, or game, disregard that. :)


Thanks. I found it in the archives. It isnt exactly for the above. It is
more to demonstrate the functionality of one of my string manipulation
functions. All is right with teh world now, or at least, my little
corner of it.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.