SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Jan 30, 2007, 04:09 #1
- 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.
-
Jan 30, 2007, 07:15 #2
- 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.htmlJake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona
-
Jan 30, 2007, 17:17 #3
- 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