SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    validation form project.... need help please!

    im fairly new at javascript but i need to write a script for a project and don't know where to begin. basically it involves form validation... i guess here's the breakdown.

    I have created a form in html already and need to figure out how to write this script.

    1.
    select any number of products (checkboxes) and set quantities for each. Must set at least one product and selected products must have a quantity value > 0.

    2. The second portion involves shipping information (ie. Name, Address, City, State, Zip, phone number, and email).
    The fields must all be filled in. The state must be a valid state code (two letters). The phone number must be all digits and 10 digits. The email must be formed at least like x@y.

    3. i then need to have a subtotal of the items, based on how many were selected and such.

    any help would be greatly appreciated,
    thanks in advance.

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I really don't recommend making validation in JavaScript, as the user can view your methods of validation and probably easily beat it. I recommend a server-side language such as PHP (which you should also make the form handling in).

    look at http://www.xs4all.nl/~sbpoley/webmatters/formval.html
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for ur arkinstall concern but this is just a project for a class... not a real site using it.


    well i borrowed a snippet of code but not sure how to get this running. heres what i got so far

    http://geocities.com/jasonchan483/scratch/script.html


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •