• Hello, I have a special case here. I need to set a select field including a blank_value required if another input field is invalid.
    I already validate the other input field via jQuery (I need to validate it via jQuery because I have to check the value of the input field with our API allowed values), this is working quite well. But, if the field is not valide, I need to set another field to required instead in my ajax call.

    So the question is, how can I set the select field to required with JQuery? I already tried to add classes wpcf7-validates-as-required and wpcf7-not-valid along with aria-required=”true” and aria-invalid=”true”, but its not working. The select is marked as invalid, but as I push the “send” button the field is not required anymore…

    Thanks a lot in advance!
    With nice regards, Lisa

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Dynamically add required field via JS’ is closed to new replies.