Hai,
i am developing a form in which i want to validate user input,am using onblur event .i want to display a validated message in a div on the same page without using alert.
pls help me to acheive this?
Display message without alert..
Moderator: General Moderators
Re: Display message without alert..
you probably want to adjust the div's innerHTML:
Code: Select all
<html><body><script type='text/javascript'>
function check(f)
{
document.getElementById('bar').innerHTML = RegExp(/[^0-9]/).test(f.value) ? 'Numbers only please!' : 'OK';
}
</script><form>
<input name='foo' onblur='check(this)'><div id='bar'></div>
</form></body></html>Re: Display message without alert..
thanks Apollo.it works fine,problem is solved..