RE: [PHP-WIN] Form and enter key
| From: | Dale Attree | Date: | Tue, 08 May 2007 11:04:28 +0000 |
| Subject: | RE: [PHP-WIN] Form and enter key | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-27837@lists.php.net to get a copy of this message | ||
In your opening form tag
<form onsubmit="CheckKey()">
In CheckKey, check if enter was hit, if so call your AJAX function.
If the submit button was clicked, your keycode will be blank and then you
can submit the form.
Dale
-----Original Message-----
From: Alf Stockton [mailto:alf@stockton.co.za]
Sent: 08 May 2007 12:57 PM
To: php windows
Subject: Re: [PHP-WIN] Form and enter key
Alf Stockton wrote:
> I have created an HTML form that contains an input type text field coded
> as:-
> <input type=text name="CardNumber" id="CardNumber"
> onBlur="sendRequest('.$ClientData.",".$Event.',this.value)">
>
> This calls an Ajax script that populates the rest of the HTML form.
>
> This fields event is currently activated, in Firefox, via the TAB but
> the user has requested that the activation be altered to Enter.
>
> The problem I have is that Enter is the default action for the form and
> I cannot think of a way to achieve what the user requires.
>
> Suggestions please.
>
This means that not only do I want to "Prevent Enter From Submitting
Form" but also cause enter to call Ajax.
In Ajax I can then
if (windows.event.keyCode != 13) return; or similar.
--
Regards,
Alf Stockton www.stockton.co.za
Don't worry so loud, your roommate can't think.
My email disclaimer is available at www.stockton.co.za/disclaimer.html
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
***********************************************************************************************
The information contained in this e-mail is confidential and may be subject to legal privilege.
Access to this e-mail by anyone other than the intended recipient is unauthorised.
If you are not the intended recipient you must not use, copy, distribute or disclose the e-mail or
any part of its contents or take any action in reliance on it. If you have received this e-mail in
error, please notify us immediately by e-mail (postmaster@jacklinenterprises.com) or telephone (+27
11 265 4200). This message is free of all known viruses. It has been screened for viruses by
Blockmail.
***********************************************************************************************