Welcome! Log In Create A New Profile

Advanced

A bit of design help (WebDev-12)

Posted by Shahine 
Shahine
A bit of design help (WebDev-12)
June 01, 2009 07:08PM
Hi All,

I need a bit of design help with a query form that I am doing in WebDev-12.

What I am trying to achieve is: User enters a search criteria in an edit control and click a query button. A query is run and the result is displayed below.

So far it is simple. My users want to press the 'Enter' key instead of clicking the 'Query' button!!?. Ok I thought.. I will add the 'Enter' key as the shortcut for my query button.

Great.. It worked.. Except that I also have a memo field 'Multi-line edit control' on the same page, and now every-time you press 'Enter' on this control to add a carriage-return the query runs. doah !!

Is there a way I can set the button shortcut by code? That way I can detect which control has the focus and either run the query or not.

Or is there a much better way altogether?


Thank You
Shahine
Fabrice Harari
Re: A bit of design help (WebDev-12)
June 01, 2009 09:02PM
Hi Shahine..

The only way i see to do that is to remove the shortcut from thebutton, and in each control where you want the shortcut to work, to use a short javascript code to detect the ENTE rkey and execute the button in that case

Best regards

Shahine
Re: A bit of design help (WebDev-12)
June 02, 2009 08:06AM
Thanks Fabrice

I was hoping there was a way of using wLanguage to assign / remove short-cuts from an object (like a button).

Maybe there is a way of doing this in Javascript? I have to Google search this!

Thanks for the reply

Shahine

Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: