Form and enter key

Form and enter key

am 08.05.2007 12:51:43 von Alf C Stockton

I have created an HTML form that contains an input type text field coded
as:-
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.

--
Regards,
Alf Stockton www.stockton.co.za

Your boyfriend takes chocolate from strangers.
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

Re: Form and enter key

am 08.05.2007 12:56:41 von Alf C Stockton

Alf Stockton wrote:
> I have created an HTML form that contains an input type text field coded
> as:-
> > 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

RE: Form and enter key

am 08.05.2007 13:04:28 von Dale Attree

In your opening form tag



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:-
> > 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.

************************************************************ ***********************************

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Form and enter key

am 08.05.2007 13:05:00 von Gustav Wiberg

Hi!

Maybe

onEnter=3D"Javascript.,,,,"

Or maybe

onSubmit=3D"Javascript...."

?

Best regards
/Gustav Wiberg
=20

-----Original Message-----
From: Alf Stockton [mailto:alf@stockton.co.za]=20
Sent: Tuesday, May 08, 2007 12:52 PM
To: php windows
Subject: [PHP-WIN] Form and enter key

I have created an HTML form that contains an input type text field coded=20
as:-
onBlur=3D"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=20
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=20
I cannot think of a way to achieve what the user requires.

Suggestions please.

--=20
Regards,
Alf Stockton www.stockton.co.za

Your boyfriend takes chocolate from strangers.
My email disclaimer is available at www.stockton.co.za/disclaimer.html

--=20
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Form and enter key

am 08.05.2007 13:24:26 von Alf C Stockton

Dale Attree wrote:
> In your opening form tag
>
>
>
> 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.
>
Thank you Dale.
What I have done so far is alter the HTML FORM line to:-
onSubmit='return false;'>
which appears to have stopped the form submitting on Enter and I have
added:-
if (window.event.keyCode != 13)
{
window.event.keyCode = 0;
return;
}
to my sendRequest() in my Ajax. This, however, appears to do nothing for me.


> 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:-
>> >> 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

Q: What's a light-year?
A: One-third less calories than a regular year.
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

Re: Form and enter key

am 09.05.2007 03:44:59 von bedul

sry OOT
----- Original Message -----
From: "Alf Stockton"
To: "php windows"
Sent: Tuesday, May 08, 2007 6:24 PM
Subject: Re: [PHP-WIN] Form and enter key


> Dale Attree wrote:
> > In your opening form tag
> >
> >
> >
> > 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.
> >
i have some problem too and related to this topic..
user type a form and then he/she enter the form that he/she will enter the
doctor name (there were 200 doctor). to small the code i use ajax, user can
click on button next to the text form. which is open new window

the main problem was i want to use shortcut. if the text form active, user
can click F6 to open new window which is same as click on the button.
==================================
>>
> > 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.
i currios about this..
when i click F2, then new window will show up.

suggestion for TS, how about not using submit but using onclick=refreshAllData()>\
user can't click on submit but must click on the link to enter the data.

> --
> Regards,
> Alf Stockton www.stockton.co.za
>
> Q: What's a light-year?
> A: One-third less calories than a regular year.
> 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
>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php