Difference between revisions of "MemEOL"
From Desal Wiki
Line 14: | Line 14: | ||
}); | }); | ||
}); | }); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
var dictionaryMagicNumbers = { | var dictionaryMagicNumbers = { | ||
Line 301: | Line 249: | ||
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.11.1/additional-methods.js"></script> | <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.11.1/additional-methods.js"></script> | ||
--> | --> | ||
+ | <script> | ||
+ | //validator | ||
+ | $( 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.' | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | }); | ||
+ | //end validator | ||
+ | </script> | ||
</head> | </head> | ||
<body> | <body> |
Revision as of 03:13, 30 October 2014
Introduction text