Alex

Alex

  • NA
  • 55
  • 16.3k

JAvascript need your help...can you help with error messages

Jun 17 2013 5:44 AM
  • Create an external JavaScript file to validate the form fields before allowing the user to submit the form. In particular you must:
    • Check all required fields have been filled in
    • Check the email address contains an "@" character and "."
    • Check the postcode contains 4 numbers (not characters)
    • Validate the credit card number has 16 numbers and the expiry date month and year must be validated against the current date.
You must output suitable error messages prompting the user what data they  are required to enter.

<h5><span style="color: red;">*</span><span> means you must fill in the details.</span></h5>
<h5><span>Your details:</span></h5> <span style="color: red;">*</span> Name: <br />
<span style="color: red;">*</span> Address: <br />
<span style="color: red;">*</span> Suburb: <span style="color: red;">*</span> Postcode: <br />
<span style="color: red;">* </span>Email address: <br />
Orders:<br />
<br />

<hr align="center" style="width: 100%;" /> <br />
Credit card details:<br />
<span style="color: red;">*</span> Type: AMEX Visa MasterCard Diners Club Bankcard <span style="color: red;">*</span> Expiry date: 01 02 03 04 05 06 07 08 09 10 11 12 2012 2013 2014 2015 <br />

<hr align="center" style="width: 100%;" /> <br />
<br />

<hr align="center" style="width: 100%;" /> <br />
<span><br clear="all" />
</span><br />
<br />
<br />
<br />

I don't know how to do error messages for all textboxes

Answers (3)