Hi Kamal,
Try this code,
Here is the javascript
<script type="text/javascript">
function validateTextBox() {
var obj = document.getElementById('txtBox');
if (obj.value > -1 && obj.value < 60) {
return true;
}
else {
alert('Range should be in 0-59');
return false;
}
}
</script>
And in html you need to call it in onBlur event, on losing its focus it will throw error.
You can change(onKeypress,onKeydown or something) when you want to throw the alert that depends on you.
HTML code:
<input type="text" id="txtBox" onblur="validateTextBox()"/>
I hope this helps you a bit.
Regards,
RK