Reply
Passing form data onto another page and calculating
Old 04-24-2008, 02:32 PM Passing form data onto another page and calculating
Resilient's Avatar
Novice Talker

Posts: 14
Name: Jaffar Khorshidi
Location: Manchester, UK
Hey guys, this is a sort of continuation from my other JavaScript thread in which I had trouble validating a form. I've managed to validate the form nicely and provided the solution there, now I'm stuck with using the actual form data to display to the user as a confirmation, what they selected as well as the total price (which must be calculated).

For a better understanding of my requirements, I've quoted my given specification below.


Quote:
Client-side processing should include some validation of input data (with the ultimate aim of answering the question – does this constitute a valid booking?), confirmation of booking details entered and calculation of total price. As a guide, all the leading e-commerce sites provide this basic level of functionality.
The highlighted red is what I'm struggling with. The concept website is for a made-up ski school, for which people can book lessons online, but I'm not required to do any server-side validation or to store any of the data anywhere. It all has to be pure JavaScript. I have attached the whole website as it currently is and would appreciate if someone could have a look at it for me and help me with the 2 remaining requirements.

Edit: Removed Attachment.

Last edited by Resilient : 04-26-2008 at 02:04 PM.
Resilient is offline
Reply With Quote
View Public Profile Visit Resilient's homepage!
 
When You Register, These Ads Go Away!
     
Old 04-25-2008, 11:48 PM Re: Passing form data onto another page and calculating
Resilient's Avatar
Novice Talker

Posts: 14
Name: Jaffar Khorshidi
Location: Manchester, UK
Is there nobody that can help me with this?
Resilient is offline
Reply With Quote
View Public Profile Visit Resilient's homepage!
 
Old 05-02-2008, 01:09 PM Re: Passing form data onto another page and calculating
nickohrn's Avatar
Weightlifting CS Student

Posts: 505
Name: Nick Ohrn
Resilient - You're not giving us any code to work with at this point. I'd love to help you, so maybe I can offer you some general guidance.

The simplest way to do this would be to add an event to the submit event of your form and pop up an alert box. This alert box could contain a couple of values. First, you could do the calculation for the total from your form inputs and display it to the user. Maybe something like:

"You current booking details indicate a total price of $xxx.xx. Are you sure you wish to proceed?"

Then, if they click "OK" you would return true which would let the form submit. Otherwise, if they click "Cancel," return false and the form won't submit. If you post some code, PM me and I'll see if I can help you.
__________________
Plugin-Developer.com - Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
nickohrn is offline
Reply With Quote
View Public Profile Visit nickohrn's homepage!
 
Old 05-02-2008, 03:05 PM Re: Passing form data onto another page and calculating
Resilient's Avatar
Novice Talker

Posts: 14
Name: Jaffar Khorshidi
Location: Manchester, UK
Hi Nick, thanks for the help. It's a bit late though lol, that's why I ended up in removing the code. Handed in my assignment with that functionality missing. I'll pm you anyway with a link to the archive so you can have a look at it for me. No harm in me learning anyway I guess. Thanks once again!
Resilient is offline
Reply With Quote
View Public Profile Visit Resilient's homepage!
 
Reply     « Reply to Passing form data onto another page and calculating
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12064 seconds with 13 queries