Jump to content

JavaScript and HTML Form Question - Figured out


Nekyia

Recommended Posts









First Name:







Last Name:







Address:







Phone Number:







Email Address:







Pizza Size:



10


12


15




Payment Method:





Visa

American Express

Master Card

Cash





Choose your toppings:



Anchovies


Double Cheese


Pepperoni


Mushrooms




SubTotal:







PST:







GST:







Total:













Link to comment
Share on other sites

One way to do it would be to remove the submit button, and replace it with a standard button which instead of submitting the form calls a function when clicked, the function can then calculate the total, enter the results into the total fields, and then submit the form.

 

 

 

Or you could have a function that is called every time the user changes any selections which updates the totals live.

 

 

 

I don't have time to write anything right now as I'm off to bed, so if nobody else has done it by tomorrow I will probably take a look.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.