That did it. Thanks. :) I still got a problem with it, but at least this 
solves one of the problems. Thanks. :)

Dinner wrote:
> You'll probably have to "cancel" the original "enter" event.
> 
> Or, you could fogogging-ogle it. =)
> 
> Re, the foggogerler:
> This can be achieved by submitting the form using the onClick event
> handler instead of onSubmit event handler. It is necessary to return
> false on event handler onSubmit to prevent submit on hitting ENTER
> key. Sample code:
> 
> <form name="form1" onSubmit="return false">
> 
> I hope mike is making alot of money off his traffic... ;-)
> 
> On 6/11/07, Phillip M. Vector  wrote:
>> 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>
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
CF 8 – Scorpio beta now available, 
easily build great internet experiences – Try it now on Labs
http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280727
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