posabsolute/jQuery-Validation-Engine — pull request #626 by hailwood (2013-03-01 01:20:07+00:00)
Title: Added ability to adjust what element a fields prompt is shown on (useful...

Adds the ability to redirect the prompt on a per-field basis.

It uses the `jqv-prompt-at` data attribute (attribute name may need to be changed to fit more with the plugin).

This feature is useful when validating hidden inputs, you may want to display the prompt on another element, or in my case, I have a plugin that hides the original input that gets validated, it then displays whatever is typed in with a mask. as such we do not want to validate the clone, but we want to prompt when the actual value does not validate shown on the clone.

This works in two ways.
**It can either be used with an ID**

//or after initialization

$('[name="something"]').data('jqv-prompt-at', '#elementClone');

**or with a full jquery object**

//some random selector chain to show how it's useful!
var $selector = $('#elementClonesParent'),children().first();
$('[name="something"]').data('jqv-prompt-at', $selector);