Code: Select all
function Validate() {
var tbl = document.getElementById("tblCalls");
var noRows = tbl.tBodies[0].rows.length;
var NotC2Tckt = eval(document.VCT.NotC2Tckt.value);
if (NotC2Tckt > 0 && noRows < 1) {
alert("Add Rows and Provide Information as the value of 'Not Converted to HD Tickets' is greater than 0.");
return false;
}
else {
alert("All is fine! Submitting");
return true;
}
}This is how I am using it in the Form Tag:
Code: Select all
<form name="VCT" action="savevoiceCT.php" method="post" onsubmit="Validate(); return false;" language="jscript">Code: Select all
alert("All is fine! Submitting");but then nothing happens. The application as specified in:
Code: Select all
action="savevoiceCT.php" If I remove "return false" from:
Code: Select all
onsubmit="Validate(); return false;" I have used the same method before and it is working fine. Where is the mistake? Any help?