'Must Validate' always dims Save button

Bauer

Well-Known Member
I'm using the 'Must Validate' option in the Validation Rules for 2 elemenst in a form - along with the 'Toggle Submit' option in the form configuration. One element is a dbj dropdown and the other is a simple 'field' element.

I want to assure the dbj element option is selected (not 'Please Select') and the field element is not empty and unique for that user. So I accomplished that using the notempty and php validation plugins respectively.

But this is a(nother) case where it would be better if that 'Must Validate' option would only be applied if New.

Here's what is happening - and once again I'm not certain if this is 'by design' (but if so maybe it should be rethought)...

In a new form everything works great - i.e. the 'Save' button is disabled until/unless both of the elements are validated.

However, in subsequent edits, the 'Save' button is always dimmed and disabled - and there is no indication to the user as to why - except for the mouse-hover 'title' value that comes up reading, 'you must validate'. HUH?

In this form, except when New, the dbj dropdown is read-only. (It shouldn't be able to be changed, except to initially select when New). So running the 'Must Validate' rule on the read-only dbj element makes no sense to begin with. I fixed that by setting the validation to only be applied when new.

However, I want to always run the validation on the field element that uses the php validation plugin to check that it is not be blank and is a unique distinct string when compared to other rows for that user.

But if I keep the validation enabled for that field element on edits, the 'Must Validate' setting causes the Save button to always be be disabled. Then, the only way to enable the Save button is to set focus to the field element and then focusout to force validation.

The thing is, of course, that element is always 'valid' when loaded - else it would have never gotten saved to begin with - and there is no indication to the user that the element 'needs attention'.
And IMO, that's "just not right" that it does.

To fix, I would suggest one of these 3 solutions - whichever Hugh finds most reasonable...
  • The 'Must Validate' option (dimming the Save button) is ignored during page loads on edits
  • Any elements using the 'Must Validate' automatically gets validated on load.
  • The 'Must Validate' option is changed to a radio button with options 'No', 'New', 'Edit', 'Both'
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top