ammweb
01-26-2009, 06:52 PM
I am wanting to validate a text box if the amount keyed in is under $15.00 an alert box pops up.
I have 5 radio buttons when the radio button for the text box is selected, I only want amount of $15.00 or more entered. If not, a message telling them $15.00 minimum. I have a script but it is validating anything after the decimal.
Can someone explain what I need to change in the script?
<script language="JavaScript">
function checkForInvalid(obj) {
if ( /[^0-14\-]|-{2,}/gi.test(obj.value) ) {
alert("$15.00 minimum offering allowed")
obj.focus();
// obj.select(); // lined removed
return false;
}
return true;
}
</script>
I have 5 radio buttons when the radio button for the text box is selected, I only want amount of $15.00 or more entered. If not, a message telling them $15.00 minimum. I have a script but it is validating anything after the decimal.
Can someone explain what I need to change in the script?
<script language="JavaScript">
function checkForInvalid(obj) {
if ( /[^0-14\-]|-{2,}/gi.test(obj.value) ) {
alert("$15.00 minimum offering allowed")
obj.focus();
// obj.select(); // lined removed
return false;
}
return true;
}
</script>