Actually I want some of the fields not to be required. I just want a null value instead of the string $address inserted into the db.
I think the best way is to check what variables exist, if they dont assign a value.
Sanjeev wrote:
Why not use Javascript to validate the form before it is sent to store the contents into the d'base?
Try something like
<Script language="JavaScript">
function validateform() {
if (form.address.value == "") {
alert( "Please enter your Address." );
form.address.focus();
return false ;
}
}
</Script>
<form action="doit.php" method=post onSubmit="return validateForm(this);">
<input type=text name=address>
<input type=Submit> </form>