-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional validation #153
Comments
This is actually a good feature request. The attribute |
This feature has now moved into the module "logic". Using the old attribute data-validation-if-checked is considered deprecated and will trigger a console warning. Validate input if a checkbox is checked <p>
E-mail:
<input data-validation="email" data-validation-depends-on="agreement" />
</p>
<p>
Lorem te ipsum
<input type="checkbox" name="agreement" value="1" />
</p>
...
<script>
$.validate({
modules: 'logic'
}); Require state if user comes from either USA or canada <p>
Home country:
<select name="country">
...
<option value="USA">USA</option>
<option value="Uganda">Uganda</option>
....
</select>
</p>
<p>
State:
<input
name="state"
data-validation="required"
data-validation-depends-on="country"
data-validation-depends-on-value="usa, canada"
/>
</p>
...
<script>
$.validate({
modules: 'logic'
});
</script> |
It's not really an issue but I try to do somethink and I just can't achieve it.
I have an input field (text): company_name not required
I have an input field company_adres (text) and I want this one to be required only if company_name is not empty
Is it possible to get this working? I know it works with a checkbox: data-validation-if-checked
But I can't get it working with a input field type text.
Sorry for my poor english.
My regards,
Francois
The text was updated successfully, but these errors were encountered: