Hi all,
I have a fairly basic enquiry form which a user will fill in from the website. This does two things:
1) emails the site owner with an address with the name, email, telephone, enquiry of the user
2) writes the name, email and phone number to a MySQL database
All this works, except, Name and Email are "required" fields, designated with an * and the "class=required" attribute. This is not the case for telehone, yet, if you leave the telephone field blank, upon submitting, the form returns an error saying that all fields must be completed.
I'm not sure this is a PHP problem, so here's the HTML
Can anyone help me work out why it's not working?
I have a fairly basic enquiry form which a user will fill in from the website. This does two things:
1) emails the site owner with an address with the name, email, telephone, enquiry of the user
2) writes the name, email and phone number to a MySQL database
All this works, except, Name and Email are "required" fields, designated with an * and the "class=required" attribute. This is not the case for telehone, yet, if you leave the telephone field blank, upon submitting, the form returns an error saying that all fields must be completed.
I'm not sure this is a PHP problem, so here's the HTML
Code:
<form id="enquiryform" action="form-process.php" method="post">
<p><label for="name">Name:</label><input type="text" class="required" id="name" name="name" maxlength="60" /><span class="warning">*</span></p>
<p><label for="telephone">Telephone:</label><input type="int" id="telephone" name="telephone" maxlength="30" /></p>
<p><label for="email">Email:</label><input type="text" class="email required" id="email" name="email" maxlength="100" /><span class="warning">*</span></p>
<p><label for="enquiry">Your enquiry:</label><textarea class="required" rows="4" cols="40" id="enquiry" name="enquiry" ></textarea><span class="warning">*</span></p>
<p><label for="callback">Please call me back:</label>
<select id="callback" name="callback" >
<option value="Anytime">Anytime</option>
<option value="Morning">Morning</option>
<option value="Afternoon">Afternoon</option>
<option value="Evening">Evening</option>
<option value="No">No thanks</option>
</select></p>
<p><label for="hearabout">Where did you hear about us?</label>
<select id="hearabout" name="hearabout" tabindex="109">
<option value="Other">Other</option>
<option value="Already a customer">Already a customer</option>
<option value="Search engine">Search engine</option>
<option value="Referred by a friend">Referred by a friend</option>
</select></p>
<p><input type="submit" class="button" name="submit" value="Submit Enquiry" /></p>
</form>
Can anyone help me work out why it's not working?