On a HTML page I have an inputbox that has a \'watermark\' on it when it is empty. (eg: \"enter text here...\"). Kind of like this: http://digitalbush.com/projects/watermark
I'm using the Watermark plugin for jQuery, but my situation was similar:
http://code.google.com/p/jquery-watermark/
It uses a classname for the display of the watermark. (I'm not sure if the DigitalBrush version uses a class or not.) I've modified the above function to use jQuery's hasClass() function to determine whether or not the field is evaluated as "empty" based on currently assigned classes.
function notWatermark(value, element){
return !$(element).hasClass("waterMarkClass");
}
$.validator.addMethod("notWatermark", notWatermark, "Required.");