Closed garygreen closed 8 years ago
Will include the value from the given fields when passing onto the validator. Useful for "chained" type validation, and the confirmed rule.
confirmed
<input name="latitude" type="hidden" value="56.384539"> <input name="latitude" type="hidden" value="56.384539"> <form> <div class="form-group"> <label>Enter your location and select from dropdown menu.</label> <input name="location" type="text" value="London, UK"> </div> </form>
Dominar.Validator.register('geolocation', function() { return this.input.latitude.length && this.input.longitude.length; }, 'Please enter a valid location.'); var dominar = new Dominar($('form'), { location: { rules: 'required|geolocation', includeValues: ['latitude', 'longitude'] } });
Will include the value from the given fields when passing onto the validator. Useful for "chained" type validation, and the
confirmed
rule.