shareyourfingerprint/res/js/form.js
2014-10-18 02:55:45 +02:00

30 lines
No EOL
698 B
JavaScript

jQuery(document).ready(function($){
$('form.idealforms').idealforms({
silentLoad: false,
rules: {
'nickname': 'max:11',
'user_ids': 'required emails',
'fingerprint': 'required fingerprint',
'key_size': 'number minmax:4:5 multiple2',
'key_server': 'url',
'expire_date': 'date:yyyy-mm-dd',
'options': 'select:default',
},
onSubmit: function(invalid, e) {
if (invalid) {
e.preventDefault();
$('#invalid')
.show()
.text('Invalid fields!');
}
}
});
$('.datepicker').datepicker('option', 'dateFormat', 'yy-mm-dd');
$('form.idealforms').find('input, select, textarea').on('change keyup', function() {
$('#invalid').hide();
});
});