Default form validation does not focus on errors for long forms

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
edcave
User
Posts: 5

Default form validation does not focus on errors for long forms

Post by edcave »

I noticed that the default validation (e.g. the required field) does not focus on errors, this is especially noticeable on long forms, when the field with the error is at the top, off the screen, so the Save button does not work and you have to manually go to the top to see the error.

There is a way to fix this? (v2024)

I used Form_customValidate to do $("#the_field").focus(), but the default validation occurs first (e.g. the required field) only after fulfilling the field the Form_customValidate code is executed, then it doesn't really work.


arbei
User
Posts: 9384

Post by arbei »

  1. Press F12 in your browser and check if there is any JavaScript errors?
  2. Was the error fields focused (with red border) even it is off-screen?

edcave
User
Posts: 5

Post by edcave »

arbei wrote:

  1. Press F12 in your browser and check if there is any JavaScript errors?
  2. Was the error fields focused (with red border) even it is off-screen?

Yes, I checked the console in the browser, there is no error about it.
And yes, the fields have red border, but the screen stays at the bottom, I need to move manually to find the marked field. Normally, in previous versions, the cursor would jump to the position on the screen where the field is marked with the red border.

I just realised, that it only happens with the TEXT, TEXTAREA and FILE field types, I tried with CHECKBOX, SELECT, RADIO and they works fine! when there is an fail the cursor jumps to that position on the screen, this not happen in TEXT field types.
Any idea?


Post Reply