Hi
I have a php form and an insert SQL statement on button click. its working great however the form even inserting empty records, therefore i need a control over there to validate empty textbox space
[CODE]form name=”frmContact” id=”frmContact” method=”POST” action=”index.php” onsubmit=”return Blank_TextField_Validator()”>
and my javascript :
[code]
<script Language=”JavaScript”>
function Blank_TextField_Validator()
{
// Check the value of the element named text_name
// from the form named text_form
if (frmContact.cid.value == “”)
{
// If null display and alert box
alert(“Please fill in the text field.”);
// Place the cursor on the field for revision
frmContact.cid.focus();
// return false to stop further processing
return (false);
}
// If text_name is not null continue processing
return (true);
}
</script>
Its not validating and not showing any alerts. any help?