Is there a way to trap an enter key with a WebTextField?

Hello,

I’d like to trap an enter key use with WebTextField to do certain functions. Is there a way to do this? I do not see any events that would work…

Thanks,
Tim

If you use the TextChanged event you might be able to, but that Event can slow down the UI a bunch, even with the best connection speeds. Are you trying to capture the Enter key in order to submit values (as if the User clicked a formal “Enter/Submit” button)?

Hi William Reynolds.

The first thing I want to do is to trap the enter key, the do a quick search to verify that the data in the field is unique.

Do you know if it can Identify the Enter key? For some reason, I think that you cannot do that, but not sure…

Thanks,
Tim

Hi Tim,

Desktop Apps can react quickly because everything is done locally. This is not the case with Web Apps. I get you need to validate the data entered in this field. What can be done is do all validations when the user commits the record - I guess your App is connected to a database - and then tell the user that the validation has failed for some fields. If you are doing Web 2.0, this can be done by displaying indicators next to the field whose value is wrong.

May I ask why this field has to hold a unique value ?

Grab the websdk and make a field yourself or talk to @Anthony_G_Cyphers , I believe he has a control that does this.

Another way to handle this is to mark one of the buttons as “default”. That should catch the user enter key being pressed and you can validate your form,

The reason the web framework doesn’t is that these types of things really need to handled completely client-side because you’ll never be able to run code fast enough with a cents going back and forth to the server.

1 Like