I want to validate a textbox, currently im using this:
<script type="text/javascript">
function validate_form (){
var Motor_Frame = document.getElementById('Motor_Frame');
if(Motor_Frame.value == ""){
alert("Please fill in Motor Frame. If no motor please fill in with N/M")
document.forms[0].Motor_Frame.focus();
return false;}
return true;
}
</script>
but i want it to check a few values the textbox is allowed:
1. if its blank display an error
2. if it doesnt equal a/p, n/r, n/q or a value between 1 and 500 then display an error.