This came up as an idea in https://github.com/backdrop/backdrop-issues/issues/5348#issuecomment-100...
@quicksketch
This issue ... may also be helpful if we were to ever add a server-side conditional system to replace
#states. By separating out the required message into its own property, we could conditionally display the required message without executing the entire form_validate()handler.
The #states property is a front-end only implementation. The lack of any server-side processing means any hidden fields cannot be required, or special validation handlers need to be added that validate field requireness manually.
Proposal
Introduce a new Form API property for designating conditional processing of parts of a form. This property would hide/show elements on the front end (like #states does already), but would also conditionally skip processing for hidden parts of the form. Hidden parts of the form would skip:
- Processing of the
#requiredattribute on hidden fields - Processing of
#element_validatehandlers on hidden fields - Remove any values from
$form_state['values']for hidden fields
Recent comments
Out of curiosity: why are these tags only relevant for admins? Don't "regular" editors on that site also need them under circumstances? Yes, the editors play nicely, no problem to...
Specific tags to work in CKEditor 5
Worked like a charm! Exactly what I envisioned... now I can edit the ruby text right in the editor, sweet:) Thank you! For those who may have a similar issue, try TinyMCE, create a new "text...
Specific tags to work in CKEditor 5
Yes, you can use TinyMCE on some content and CKEditor5 in others. There is no problem having both enabled on a system.
Specific tags to work in CKEditor 5