Welcome Guest, Not a member yet? Register   Sign In
Validate fields if checkbox is not checked

(This post was last modified: 11-22-2021, 11:05 AM by eleumas.)

Hi, i would like validate with "required" some fields only if checkbox is not checked.
Is possible? How can i do?

I thought which i could change checkbox in a dropdown and validate others fields only if has been selected a specific value from dropdown (in my case value 2).

PHP Code:
<select name="shipping-method">
option value="1">pickup in store</option>
option value="2">courier service</option>

This solution could be more easy? Any suggestion for me? Thanks.

I think you need the required_without validation rule.

See the docs for more information.

Theme © iAndrew 2016 - Forum software by © MyBB