I have a form with 4 textboxes and a label at the end of the textboxes. I would like to change the label to complete once the input’s value has been changed. I do not want to use a button to fire this event and instead would like to monitor when the field loses focus, such as through tabbing to the next input or clicking out of the current input. Tricky part is that there is a default value (ghost text) in each text box, which will have to be checked before marking the corresponding input as complete. So I am going to have to check whether the css color of the text is set to the “ghost text” color before the validation is complete.
Thanks.
This worked fine for what i needed, thanks guys
function ontextChange() {
$(‘input:text,textarea’).keyup(function () {
$(‘input:text,textarea’).each(function () {
if ($(this).val() != ”) {
$(‘[id$=lblUploadStatus]’).html(‘Ready to upload.’);
}
else {
$(‘[id$=lblUploadStatus]’).html(‘Incomplete’).css({ ‘color’: ‘red’ });
}
});
});
}