D
Dave
I have an HTML form that requires some hefty scripting and I realize
I'll likely have to pay for help. In the end, it has to create a
string where each of 5 record items is separated by :: and each record
is separated by |.
The form has 1 input type field in the first and last column of a four
column table and there are currently 24 rows. Consider one row: Field
1 (F1) is an input box with a 2 character limit and each name is a
code (e.g. AS97). It must only accept integers from 1 to 20 or be
empty. Field 2 (F2) is a read-only input box. If user enters 1 in F1,
1 is multiplied by a dollar value constant (C) to give a dollar value
in F2. If the value in F1 is 2, the value in F2 is C-2%. If F1 is 3,
F2 is C-3% and so on. I have a simple formula that should accomplish
this: C*(100-F1)*0.01. Obviously, this has to be driven by an onChange
or similar event. But wait, it gets better. Each row works this way,
and needs it's own constant. So in effect, there is a line total (I am
not capturing this) and a form total. I only need to stop the
submission process if the form total exceeds amount 'X'. If all is OK,
we proceed to send values: Price::Qty::Code:escription::{FLAGS} for
each row, where Price is the value of F2, Qty is F1, Code is the name
of F1, Description will likely be another 'read only' input box, and
{FLAGS} are fields I need to tack onto the end. It could be one or up
to four, so I have to be able to modify this. An example of {Flags}
would be {PST}.
So if there are 3 rows with values for F1, the string could resemble:
10.00::1::AS97::blah description1::{PST}{TEST}|20.00::2::ET97::blah
description2::{PST}{TEST}|5.00::10::ETP2K::blah
description3::{PST}{TEST}
That's 95% of it. Maybe JavaScript is best used to produce a form
total (to check against the maximum 'X' and force integers in F1 but
not the rest? Any takers?
I'll likely have to pay for help. In the end, it has to create a
string where each of 5 record items is separated by :: and each record
is separated by |.
The form has 1 input type field in the first and last column of a four
column table and there are currently 24 rows. Consider one row: Field
1 (F1) is an input box with a 2 character limit and each name is a
code (e.g. AS97). It must only accept integers from 1 to 20 or be
empty. Field 2 (F2) is a read-only input box. If user enters 1 in F1,
1 is multiplied by a dollar value constant (C) to give a dollar value
in F2. If the value in F1 is 2, the value in F2 is C-2%. If F1 is 3,
F2 is C-3% and so on. I have a simple formula that should accomplish
this: C*(100-F1)*0.01. Obviously, this has to be driven by an onChange
or similar event. But wait, it gets better. Each row works this way,
and needs it's own constant. So in effect, there is a line total (I am
not capturing this) and a form total. I only need to stop the
submission process if the form total exceeds amount 'X'. If all is OK,
we proceed to send values: Price::Qty::Code:escription::{FLAGS} for
each row, where Price is the value of F2, Qty is F1, Code is the name
of F1, Description will likely be another 'read only' input box, and
{FLAGS} are fields I need to tack onto the end. It could be one or up
to four, so I have to be able to modify this. An example of {Flags}
would be {PST}.
So if there are 3 rows with values for F1, the string could resemble:
10.00::1::AS97::blah description1::{PST}{TEST}|20.00::2::ET97::blah
description2::{PST}{TEST}|5.00::10::ETP2K::blah
description3::{PST}{TEST}
That's 95% of it. Maybe JavaScript is best used to produce a form
total (to check against the maximum 'X' and force integers in F1 but
not the rest? Any takers?