Hello all,
Code:
- $(document).ready(function(){
- //alert('Document is ready');
- $("#submit").click(function(){
- //set error messeges
- var errNumeric = "Only numeric(1-9) characters allowed.";
- var validate = {
- "validateRules": [
- {
- "fieldId": "registration",
- "errMsg": "errEmail",
- "errDivID": "regmsg",
- "pattern": "regexNumeric"
- }
- ]
- };
- alert(validate.validateRules[1].errMsg);
-
- });
- });
I have my errMsg variable already set and would like to use the text within that variable in JSON: "errMsg": "errEmail",How do I accomplish an alert of the text in the errEmail variable instead of the text "errEmail"?
Thanks,
Rich