The following example is a bit more advanced. In this case the help text changes while the user is entering data into the input element.
The example shows how to set up the initial text and how to change it while the user is typing.
While all the previous examples are set up with static text, this example uses a callback to set the initial text.
The same pattern can be used to get the text dynamically from a server, and thereby delaying the transfer of help text.
$("#sometextarea").AddHint({/
onshow: function(element) {
return "Write a description of your issue below in 200 characters."
}
});
... and hereafter...
$("#sometextarea").keydown(
function() {
var element = $("#sometextarea");
if ($(element)[0].value.length > 10) {
var thetext = "Write a description of your issue below. You have used " + $(element)[0].value.length + " of 200 characters.";
element.ShowHint({ text: thetext });
}
}
);}
);
(Try typing more than 10 characters...)