PDA

View Full Version : JavaScript Gurus Please Help


saber
18-05-2003, 03:26 PM
I am learning JavaScript and have the following revision question to complete - can someone please get me started on the calculation bit?

Question:
Add a text box to the order form that displays the number of items that the customer wants 10 or more of.
Eg

If the customer wants
1 x item 1
10 x item 2
11 x item 3

The text box will display 2.

Thanks
:wave:

Dalehead
18-05-2003, 03:33 PM
Surely it should display 2 and 3?

saber
18-05-2003, 03:56 PM
No only 2 items that the customer wants 10 or more of.

saber
18-05-2003, 10:03 PM
Please view source on the following link to see the code for the order form.

http://www.eastfields.nildram.co.uk/jac/orderfm.html
I have done the box for the answer I just don't know how to get the answer there! :-(

SuperFLY
19-05-2003, 11:51 AM
i wrote some random thing.. not sure if it does what you need but it might steer you in the right direction?

http://www.hlccl.com/superfly/jstest.htm

saber
19-05-2003, 07:06 PM
That helps with what I need to write first and last but it's the middle bit I'm struggling with as the items in the order form are in an external js file. Please login to the site at:
http://www.eastfields.nildram.co.uk/jac/index.html
click the catalogue link and log in as

Tom Jones (case sensitive)
password is flob

Click continue
As you will see there are over 80 items on the order form so I would have a lot of "boxes".
The quantities must go into a string I just don't know where to pull it from.
Thanks in advance.

SuperFLY
19-05-2003, 08:14 PM
could have all the fields in an array and for it to check the array every time keyPress= is made?

im not gonna do ur project for you.. but its an idea ;)

mindz
20-05-2003, 02:58 PM
thanx for the help lads ... much appreciated

you aint seemed to have got to grips with java have u jac ?? probably all the drinking you do in between coding :tongue:

saber
20-05-2003, 03:03 PM
It's not a project it's a possible question for my exam which I still don't understand.
But thanks anyway.