Why is the hidden form not shown when it looses focus? The alert is coming up nicely when leaving the input but the other hidden form is still not there.
html
<body>
<input type="text" id="myinput" value="">
<input type="hidden" id="validation_message_email" value="enter a valid email">
</body>
javascript
window.onload = function() {
$("#myinput").blur(myAlert);
};
function myAlert() {
alert("This input field has lost its focus.");
$("#validation_message_email").show();
}
type="hidden"I think you need<span style="display:none" id="validation_message_email">enter a valid emai</span>type='hidden'doesn't directly implies that the element is hidden, it means the control itself is a type known as 'hidden'. You cannot change it, so its recommended you use a<div>or<span>tag, set the css asdisplay:noneinitially, and then later call the jqueryshow()function on the element.