Created
June 15, 2016 08:46
-
-
Save djeet/efbd4e6a6e875f12b192035d1a8f6797 to your computer and use it in GitHub Desktop.
Envoke Real Time Validation to Trigger Custom Message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Configure message and ID | |
*/ | |
var error_message_custom = "___YOUR MESSAGE_HERE_____"; //Your custom error message | |
var current_field_id = 1; // Your Field ID | |
/** | |
* Script to envoke Real Time Validation to maintain error state | |
*/ | |
all_validations[current_field_id].message = error_message_custom; | |
all_validations[current_field_id].validationFailed = true; | |
all_validations[current_field_id].displayMessageWhenEmpty = true; | |
all_validations[current_field_id].insertMessage(all_validations[current_field_id].createMessageSpan()); | |
all_validations[current_field_id].addFieldClass(); | |
all_validations[current_field_id].afterInvalid(all_validations[current_field_id].element); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@djeet thanks for this example.
all_validations[current_field_id]
->all_validations[current_form_id][current_field_id]
all_validations[1][12].validationFailed
to be filled out, before attempting a check ( or not )You could have a hook inside
afterInvalid()
andafterValid()
- something like this