Difference between revisions of "MemEOL"
From Desal Wiki
Line 17: | Line 17: | ||
//validator | //validator | ||
$( document ).ready(function() { | $( document ).ready(function() { | ||
− | + | mw.loader.using( 'jquery.ui.core', function () { | |
− | + | $('.form-memEOL').bootstrapValidator({ | |
− | + | message: 'This value is not valid.', | |
− | + | live: 'enabled', | |
− | + | feedbackIcons: { | |
− | + | valid: 'glyphicon glyphicon-ok', | |
− | + | invalid: 'glyphicon glyphicon-remove', | |
− | + | validating: 'glyphicon glyphicon-refresh' | |
− | + | }, | |
− | + | submitButtons: '.memEOL-submit', | |
− | + | fields: { | |
− | + | damagedMembranes: { | |
− | + | validators: { | |
− | + | notEmpty: { | |
− | + | message: 'Please indicate if the membrane has been damaged.' | |
− | + | } | |
− | + | } | |
− | + | }, | |
− | + | testedPermeability: { | |
− | + | notEmpty: { | |
− | + | message: 'The permeability of your membranes is a required parameter for this decision tool.' | |
− | + | }, | |
− | + | stringLength: { | |
− | + | max: 100, | |
− | + | message: 'Permeability value is too long.' | |
− | + | }, | |
− | + | regexp: { | |
− | + | regexp: /^[0-9]+([\.][0-9]+)?$/, | |
− | + | message: 'Please enter a number (eg. 2.0).' | |
− | + | } | |
− | + | }, | |
− | + | NaClRejection: { | |
− | + | notEmpty: { | |
− | + | message: 'The salt rejection of your membranes is a required parameter for this decision tool.' | |
− | + | }, | |
− | + | stringLength: { | |
− | + | max: 20, | |
− | + | message: 'Salt rejection value is too long.' | |
− | + | }, | |
− | + | regexp: { | |
− | + | regexp: /^[0-9][0-9]?([\.][0-9]+)?$/, | |
− | + | message: 'Please enter a number between 0 and 100.' | |
− | + | } | |
− | } | + | } |
+ | } | ||
+ | }); | ||
}); | }); | ||
}); | }); |
Revision as of 02:57, 30 October 2014
Introduction text