I was reviewing #4509 and was playing with @indigoxela's PR on my local, trying to conditionally show/hide a warning if webp was added to the list of allowed extensions for an image field instance.
A condition like this, where the value is "static" works fine:
'#states' => array(
'visible' => array(
':input[name="instance[settings][file_extensions]"]' => array('value' => 'png, gif, jpg, jpeg, webp'),
),
),
But the goal is to check the value of the field for any occurrence of webp. Unfortunately, #states doesn't seem to support regex OOTB
With some research, I've found this article: https://evolvingweb.ca/blog/extending-form-api-states-regular-expressions which would allow something like this:
'#states' => array(
'visible' => array(
':input[name="instance[settings][file_extensions]"]' => array('regex' => array('value' => '^.*webp.*$')),
),
),
Recent comments
Hi! The description is still very vague and lacks step-by-step instructions on how to reproduce. It doesn't include the version of Backdrop either, nor a list of contrib modules you are using...
Problems with HTML content and text formats
Sorry, it did seem confusing when I read it back... So if I add some html to a text field, for example in a page or a block, whatever the text format of the field may be (raw html or basic...
Problems with HTML content and text formats
Could you please post clear, step by step instructions to reproduce the problem? Your first message refers to HTML content, and your second to text formats. Please add details to reproduce each...
Problems with HTML content and text formats