Closed

Javascript function to validate billing form

This project received 32 bids from talented freelancers with an average bid price of $23 USD.

Get free quotes for a project like this
Employer working
Skills Required
Project Budget
$10 - $30 USD
Total Bids
32
Project Description

I have a page with order and billing information. All I need is to validate the input values from user. Here are requirements!

First Name (name=first): check for non blank and nonzero length.
Last Name (name=last): check for non blank and nonzero length.
Street Address (name=address): check for non blank and nonzero length.
City (name=city): check for non blank and nonzero length.
State (name=state): check for non blank and nonzero length.
Zip (name=zip): must provide either a 5-digit zip code or a 5+4 zip code (all must be numbers and check for the length. The script must allow the user to enter either 5 digits or 9 digits. So when the user enters 5 digits, it's OK. Another user enters 9 digits, it's also OK).
Telephone number (name=phone): the format must be (xxx) xxx-xxxx.
(Check for the exact format with the numbers. Use only one field for the phone).
EMail (name=email): check for non blank and nonzero length.
Credit card number (max length is 16) (name=ccnum): check for a 16 digit number.
Select list for credit card type (name=cctype)
Credit card expiration date (format is mm/yyyy) (name=ccexpire): check for the format mm/yyyy. (Make sure that the card is valid by comparing with the current date). You can use the date object if you want.

All forms are done, need just Javascript function to validate this form!

[url removed, login to view] file included

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online