Validate: need dynamic message on failed validation

Validate: need dynamic message on failed validation

I need to include the contents of a field in a validation error message.
I tried using a closure around the addMethod call as demonstrated in the code below, but that does not work.  Is there a way to do this?

Thanks!
  1.     (function() {
  2.         var msg = "Closed items cannot be linked to items of type ";
  3.         jQuery.validator.addMethod("closedLinkRestriction",
  4.                 function(value, element) {
  5.                         if (value === undefined || value === '') return true;

  6.                         var selectedType = getExtendedLookupData($("#TypeLookup").data('lookupData'), element);
  7.                         if (selectedType.CanLinkToClosedItems) {
  8.                             msg += $.trim(selectedType.Description) + '.';
  9.                             return false;
  10.                         }
  11.                         else {
  12.                             return true;
  13.                         }
  14.                 },
  15.                 msg
  16.             );
  17.     })();