File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 42
42
confInputName = $el.valAttr('confirm') || ($el.attr('name') + '_confirmation'),
43
43
$confInput = $form.find('[name="' +confInputName+ '"]').eq(0);
44
44
45
- if ( $confInput ) {
45
+ if ($confInput.length ) {
46
46
conf = $confInput.val();
47
47
if( config.validateOnBlur && !$confInput[0].hasValidationCallback ) {
48
48
$confInput[0].hasValidationCallback = true;
56
56
});
57
57
}
58
58
} else {
59
- alert('Could not find an input with name "'+confInputName+'"');
59
+ $.formUtils.warn('Password confirmation validator: could not find an input ' +
60
+ 'with name "'+confInputName+'"');
61
+ return false;
60
62
}
61
63
62
64
return value === conf;
Original file line number Diff line number Diff line change 233
233
</form>
234
234
<hr />
235
235
<form id="form-b">
236
+ <h4>Validate on submit</h4>
236
237
<div class="form-group">
237
238
<label class="control-label">Test</label>
238
239
<input name="test" data-validation="number" type="text" />
239
240
</div>
240
241
<div class="form-group">
241
242
<label class="control-label">Password</label>
242
- <input name="pass" data-validation="confirmation" type="password" />
243
+ <input name="pass" type="password" />
243
244
</div>
244
245
<div class="form-group">
245
246
<label class="control-label">Password again</label>
246
- <input name="pass_confirmation" type="password" />
247
+ <input data-validation-confirm="pass" type="password"
248
+ data-validation="confirmation" />
247
249
</div>
248
250
<p>
249
251
<input type="submit" class="button">
You can’t perform that action at this time.
0 commit comments