Javascript Form Major Help

Dr Octogonapus

Active member
Regular
Joined
Nov 10, 2009
Messages
1,522
Kin
0💸
Kumi
0💴
Trait Points
0⚔️
Hello I am in desperate need of some help. I'm building a dvd store website and I want to add a javascript component. A form that uses javascript and submits form data (ie shopping cart information) to a processing script.

The form must submit using the post method and have the following properties:

A visible unit price to 2 decimal places for the product or service
A hidden form field where a product code for this item is stored (can be "p1" for example)
A quantity field allowing only a positive integer which represents the number of items being ordered.
A customer can enter the amount directly
A minus(*)and a plus(+)button that updates the quantity field by1unit
A submit button (can be called "Add" or "Buy" etc)
The form won't submit if the quantity field is not a positive integer.

I have no idea how to even start this so if anyone can help me that would be fantastic. Cheers.
 

Maaggel

Member
Joined
Oct 13, 2011
Messages
415
Kin
0💸
Kumi
0💴
Trait Points
0⚔️
Here we go :)

You can download the file here:


But please note that you should always have the javascript in a seperate file - I've just made this as simple as possible.
And I'm using jQuery 1.11.0 - but you should be able to use any newer versions :)

I hope it helps - and feel free to ask if you got any questions.
 
Last edited:

Maaggel

Member
Joined
Oct 13, 2011
Messages
415
Kin
0💸
Kumi
0💴
Trait Points
0⚔️
No problem :)

I enjoy such things - and since I'm working as a programmer/designer full time, it wasn't that big a problem :)

And good luck with your project!
 
Top