Hi i have a onblur within a input textbox, when the user presses enter i need to validate what has been entered in to the textbox.
i have tried the code below, the alert pops up fine but then my form still submits, how can i stop the form submitting?
[code]
<script language=”javascript”>
<!–
function checkQty(thisform, entry)
{
if (thisform.value < 1)
{
thisform.value = “0”
alert (“This is a Javascript Alert”)
return false
}
if (thisform.value > entry)
{
alert (“This is a Javascript Alert”)
return false
}
}
–>
</script>
<input type=”text” name=”QtyTextBox<%=i%>” size=”3″ onblur=”checkQty(this, <%=strLeft%>)” maxlength=”5″ value=”0″/>