I think a better practice would be to not use the enter button. What Ajax
framework if any are you using? Most should have a watcher / observer event
type system to monitor changes to a specific element. 





"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Phillip M. Vector
To: CF-Talk
Sent: Tue Jun 12 00:18:05 2007
Subject: OnEnter issues

I have a form that I'm using with AJAX calls to the DB.

I'd like to use Enter to call the AJAX function. However, the form is 
trying to submit itself when I press enter.

Is there a way of disableing enter from submitting a form on a page? Or 
is there a workaround that someone can think of? I've tried redirecting 
the form back to the form itself, but the problem becomes that I have a 
onkeydown already defined and that seems to be taking presidence on the 
calls. So it goes to the keydown and doesn't go to enter..

Any ideas?

<body onload="showmessages()">
<cfoutput>
        <form action="#self#Chat.Default" method="Post">
                Message:
                <input type="text" id="Message" onenter="entermessage()" 
onkeydown="showmessages()" size="40">
                <input type="Hidden" id="Room" value="1">
        </form>
</cfoutput>
<HR>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280738
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to