From 81908143a5441729153605dc4eed95b39e8f7254 Mon Sep 17 00:00:00 2001
From: Matt Moore
+ Average points
+ History (50 characters left)
+
+
+ What's your favorite color?
+
+
+ How much do you want to donate?
+
+
+
+ Password (at least 8 characters)
+
+
+ Confirm password
+
+
+ E-mail
+
+
+ Repeat e-mail
+
+
+ E-mail:
+
+
+ Credit card number
+
+
+ Security code (cvv)
+
+
+ Credit card
+
+
+ Credit card number
+
+
+
+
+ Contact me:
+
+
+ E-mail:
+
+
+ Country:
+
+
+ State:
+
+
+ Home phone number:
+
+
+ Cell phone number:
+
+
+ Work phone number:
+
+Validate on submit
+ Validation Module: Poland
errorMessageKey: 'badEvenNumber',
});
+ // UK Surname Proper Casing
+ $.formUtils.addSanitizer({
+ name : 'proper_case',
+ sanitizerFunction : function(value) {
+ value = value.toLocaleLowerCase();
+ value = value.substring(0, 1).toUpperCase() + value.substring(1);
+ intPointer = value.indexOf(' ');
+ while (intPointer > -1) {
+ value = value.substring(0, intPointer + 1) + value.substring(intPointer + 1, intPointer + 2).toUpperCase() + value.substring(intPointer + 2);
+ intPointer = value.indexOf(' ', intPointer + 1);
+ }
+ intPointer = value.indexOf('-');
+ if (intPointer > -1)
+ value = value.substring(0, intPointer + 1) + value.substring(intPointer + 1, intPointer + 2).toUpperCase() + value.substring(intPointer + 2);
+ intPointer = value.indexOf('O\'');
+ if (intPointer > -1)
+ value = value.substring(0, intPointer + 2) + value.substring(intPointer + 2, intPointer + 3).toUpperCase() + value.substring(intPointer + 3);
+ intPointer = value.indexOf('Mc');
+ if (intPointer > -1)
+ value = value.substring(0, intPointer + 2) + value.substring(intPointer + 2, intPointer + 3).toUpperCase() + value.substring(intPointer + 3);
+ intPointer = value.indexOf('Mac');
+ if (intPointer > -1)
+ value = value.substring(0, intPointer + 3) + value.substring(intPointer + 3, intPointer + 4).toUpperCase() + value.substring(intPointer + 4);
+ return value;
+ }
+ });
+
window.applyValidation = function(validateOnBlur, forms, messagePosition, xtraModule) {
if( !forms )
forms = 'form';
From 0bdf3e31389ef304f80a89bd5be1f14bd5b66fea Mon Sep 17 00:00:00 2001
From: Nick Holden {fields}
{fields}
",field:"{fields}
'+
+ '{fields}
',
+ field: '
+
+ {fields}
'+
- '{fields}
',
- field: '{fields}
{fields}
",field:"data-validation-strength
to 1, 2 or 3 depending on how strong password you require.
+
+If you want the strength of the password to be displayed while the user types you call displayPasswordStrength()
in the end of the form.
+
+```
+
+
+
+
+
+```
+
+### Server side validation
+
+By using this validator you can validate the value given by the user on the server before the form gets submitted. The validation function will send a POST request to the URL declared in data-validation-url
. The argument posted to the URL will have the same name as the input being validated.
+
+The form will get the class validating-server-side while the server is being requested.
+
+The response from the validation script must be a JSON formatted object, containing the properties "valid" and "message".
+
+```
+{
+ "valid" : true|false,
+ "message" : "String with text that should be displayed as error message"
+}
+```
+
+#### Form
+
+```
+
+```
+
+#### /validate-input.php
+
+```
+ false,
+ 'message' => 'Post argument "user" is missing.'
+);
+
+if( isset($_POST['user']) ) {
+ $userRepo = new UserRepository( DataStorage::instance() );
+ $user = $userRepo->loadUser( $_POST['user'] );
+
+ if( $user ) {
+ // User name is registered on another account
+ $response = array('valid' => false, 'message' => 'This user name is already registered.');
+ } else {
+ // User name is available
+ $response = array('valid' => true);
+ }
+}
+echo json_encode($response);
+```
+
+**Modifying the server request**
+
+The parameter containing the input value, sent to the server, will by default have the same name as the input. You can however set your own parameter name by using the attribute data-validation-param-name
. You can also send along other parameters to the server by using the attribute data-validation-req-params
.
+
+```
+$user->get('ID')));
+?>
+letternumeric
you can validate that given input value only contains letters and/or numbers. This validator allows any type of character in contrast to the alphanumeric validator, which only allows letters A-Z.
+
+```
+
+
+
+
+
+```
+
## Changelog
#### 2.3.19
From fb8b52f3792c152c13c59975abb8eac8e3a6809b Mon Sep 17 00:00:00 2001
From: Victor Jonsson letternumeric
you can validate that given in
```
+## Date validators
+
+### Birthdate
+
+This validator is the same as the default date validator except that it only allows past dates and dates that is not older than 120 years.
+
+```
+
+
+
+
+
+
+
+
+```
+
+## Time
+
+```
+
+
+```
+
## Changelog
#### 2.3.19
From a4c458fb0b52be9e474156f81aad527af24def8a Mon Sep 17 00:00:00 2001
From: Victor Jonsson data-validation-allowing
exists in the mime type declaration of the file. This means that data-validation-allowing="pdf"
will work in both modern browsers (checking against "application/pdf") and older browsers (checking the file extension ".pdf").
+
+```
+
+
+
+
+
+```
+
+Validating multiple files (with separate error messages depending on failed validation):
+
+```
+
+```
+
+### Image dimension and ratio
+
+Use the validator dimension
to check the dimension of an image (jpg, gif or png).
+
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+Use the attribute data-validation-ratio
to validate that the uploaded image has a certain ratio
+
+```
+
+
+
+
+
+```
+
+
## Changelog
#### 2.3.19
From cac6a2790498bf13d12f21618706dcfb7b010f76 Mon Sep 17 00:00:00 2001
From: Victor Jonsson data-validation-ratio
to validate that the upload
```
+## Logic
+
+### Validators depending on each other
+
+Use the attributes data-validation-depends-on
to configure that an input is optional as long as another input is left without an answer.
+
+```
+
+data-validation-optional-if-answered
to tell the validator that only one, out of a group of inputs, requires an answer.
+
+```
+