Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="row">
- <div class="col-md-6">
- <div class="form-group">
- <label> <span>Amount to Player</span></label>
- <input name="AmountToHorse" type="text" class="form-control">
- </div>
- </div>
- <div class="col-md-6">
- <div class="form-group">
- <label> <span>Amount to Stable</span></label>
- <input name="AmountToStable" type="text" class="form-control">
- </div>
- </div>
- </div>
- $('#reloadForm').validate({
- rules: {
- AmountToHorse: {
- required: true,
- number: true
- },
- AmountToStable: {
- required: true,
- number: true
- },
- }
- });
- $(document).ready(function () {
- $.validator.addMethod('onlyOne', function(value, element, param) {
- return this.optional(element) || $('[name="' + param[0] + '"]').is(':blank');
- }, "Please fill out only one of these fields");
- $('#myform').validate({
- rules: {
- foo: {
- onlyOne: ["bar"]
- },
- bar: {
- onlyOne: ["foo"]
- }
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement