I'm trying to validate text field using javascript. return false is working fine. but return true is not working.
HTML
<form namme="frms" action="booking_management.php">
<input type="text" name="total" id="totald" value="" onkeyup="calbill()" class="input"/>
<input name="but" type="button" value="Send Bill" class="btn btn-primary" onClick="bill()" />
</form>
JavaScript
function bill() {
if (Checktot()) {
document.forms["frms"].submit();
}
}
function Checktot() {
var tot = document.getElementById("totald").value;
if (tot == "no") {
document.getElementById("totald").style.borderColor = "#ED291F";
alert("Please try again");
return false;
}
return true;
}
namme="frms"