setting a variable to use within JSON. Please help

setting a variable to use within JSON. Please help

Hello all,


Code:

    
  1.       $(document).ready(function(){
  2.             //alert('Document is ready');
  3.             $("#submit").click(function(){
  4.                //set error messeges
  5.                 var errNumeric = "Only numeric(1-9) characters allowed.";

  6.                 var validate = {
  7.                             "validateRules": [
  8.                                     {
  9.                                     "fieldId": "registration",
  10.                                     "errMsg": "errEmail",
  11.                                     "errDivID": "regmsg",
  12.                                     "pattern": "regexNumeric"
  13.                                 }
  14.                             ]
  15.                         };
  16.                 alert(validate.validateRules[1].errMsg);
  17.    
  18.             });
  19.         });
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