pradosoft / prado

Prado - Component Framework for PHP
Other
187 stars 70 forks source link

TPanel "Enter" behavior #994

Open kegs85 opened 4 months ago

kegs85 commented 4 months ago

I have an issue with our site where, under (our deployed) Prado 3.2 pressing enter or scanning with a barcode scanner configured with carriage return would move the cursor to the next logical text box. Since we have upgraded to 4.2, I have reconfigured most affected TPanel elements to have an appropriate default button tag however, I am unsure if the above behavior is something that is naturally supported in configuration (could not see in API docs) or if a mod/JS function needs to be implemented to support it.

Is there a configuration that can achieve this or should I skip straight to designing the solution? There is a chance our previous Prado implementation was modified to achieve this, it is, however, definitely not in our obvious custom code.

ctrlaltca commented 4 months ago

I don't think Prado has a way to focus the next text field on enter. The only thing that comes to my mind is if you have a few text fields, each one causing a postback and with a validator set with "FocusOnError". When you fill the first field and press "enter", the postback will trigger the validator for the second field causing it to be focused, and so on for the following fields. This is probably something easier to implement with some custom javascript.

belisoful commented 4 months ago

I was thinking that, this is 2024, There should be some kind of HTML tag value option for such a thing, or maybe css?

There is a lot of html that has been upgraded and updated since last time TWebControls were synergized with the latest HTML standard. There are a number of things that we can do to upgrade PRADO at this time in such regard.