WebTextField.TextChanged and Chr(13) to trigger submit

For any field where a value is entered it’s common to accept the CR as an indication that the user is done entering data and wants to submit it. My WebTextField.TextChanged event works as expected on all characters except a Carriage Return. What am I overlooking?

Are you setting the field’s value as the following and expecting something to happen:

myField.Value = "something" + Chr(13)

Or do you mean that pressing the Enter key on your keyboard doesn’t trigger an action?

The right way to do this currently is to have a button with the Default property set to True. When hitting the Enter key, the Button’s Pressed event will be triggered.

Return and ESC are captured at the page level and trigger the buttons that are designated as Default and Cancel respectively.

These in turn tell all TextFields and TextAreas to first send their latest data to the server if necessary before sending their Pressed event.

1 Like

You can even create WebContainers with their own Default and Cancel buttons that trap these events and don’t trigger the Pressed events of other Default and Cancel buttons on the same page.

It’s a combo of fields used for a login (in this instance). The UserID (email address) is on field, then a tab takes you to PWD field where user types in their password - then intuitively they’ll hit the CR/Enter key to ‘submit’ their login. It’s the CR/Enter value I’m hoping to detect.

Presumably you also have a “Login” button. If so, set its Default property to True in the Inspector and execute your login from its Pressed event. Then, when pressing Enter on one of the fields, this will execute.

Yep - that works perfectly (‘Default’). I’ll follow the design guidelines as @Greg_O_Lone cited above. I will have other pages with more than one area container that accepts user input, so I’ll have to prototype having several ‘Default’ buttons in several containers and studying what that does.