P
penelope
Anybody who has any input, please respond. Look below.
__________
Thanks Stefan.
Can I add more that one operation to the html.
Let's say I have field 1 and field 2 in the form.
Once I submit, I want to get 'total1' and 'total2' where
total1 is the sum of the two fields and total2 is the
multiplication of the two fields.
I have created the two hidden fields 'total1'
and 'total2' in the form and added them to the
confirmation page. Do I just write the code below two
times? - like this? - I have tried this and I get one
total but not the other:
onclick="this.form.total1.value = parseInt
(this.form.field1.value) + parseInt
(this.form.field2.value);return true;"
onclick="this.form.total2.value = parseInt
(this.form.field1.value) * parseInt
(this.form.field2.value);return true;"
do I need to put some kind of sign in between?
thanks in advance
Penelope
___________
Try changing the formula to:
onclick="this.form.total.value = (this.form.field1.value-
0) + (this.form.field2.value-0);return true;"
Or
onclick="this.form.total.value = parseInt
(this.form.field1.value) + parseInt
(this.form.field2.value);return true;"
--
message | I am trying to add two form fields so the come up as a
| total in a confirmation page. I finally got the
| instructions on how to do it. I do the following
(below -
| also the whole chain of e-mails), but in the
confirmation
| page I do not get the addition but instead one number
| after the other (ex: if I add 4 + 5 I get 45 and not 9).
| If I change the sign on the event handler from an
| addition (+) to a multiplication (*) it works well (ex:
| if I multiply 4 * 5 I get 20)
|
|
| Any ideas on what may happen?
|
| _____________This is what I do_______
| add an onclick event handler
| onclick="this.form.total.value =
this.form.field1.value
| + this.form.field2.value;return true;"
|
| where field1 and field2 are the 2 field names of the
| fields you want to total
|
| Create a hidden form field for the total and add that
| field to your confirmation page
|
| _______This is the whole chain of E-mails________
|
| Subject: Re: need to do math in a form with fp2002
| From: "Stefan B Rusynko" <[email protected]> Sent:
| 8/10/2003 3:26:19 AM
|
|
|
|
| Create a hidden form field for the total and add that
| field to your confirmation page
| In the form, right click | Form Properties | Advanced |
| Add | Name the field (say total) and give it a value
(say
| 0).
|
| In the submit button add an onclick event handler
| onclick="this.form.total.value =
this.form.field1.value
| + this.form.field2.value;return true;"
|
| where field1 and field2 are the 2 field names of the
| fields you want to total
|
| PS use validation to make sure Fields 1 & 2 are required
| fields
| --
| _____________________________________________
| SBR @ ENJOY (-: [ Microsoft MVP -
FrontPage ]
| "Warning - Using the F1 Key will not break anything!"
(-;
| To find the best Newsgroup for FrontPage support see:
| http://www.net-sites.com/sitebuilder/newsgroups.asp
| _____________________________________________
|
|
| message | | I need help with the following task:
| |
| | I have a page where there is a form. Two field in that
| | form require that you input a number. Once you click
| | submit, all the data in the form, gets sent to a
| | database. You then get a customized confirmation page
| | where you see the data that you have entered in the
| | database.
| |
| | Also, I need to display a total, which is the sum of
the
| | two number entered in the form and into the database.
| |
| | Any ideas?
| |
| | Thanks,
| |
| | Regards
|
|
...
..
__________
Thanks Stefan.
Can I add more that one operation to the html.
Let's say I have field 1 and field 2 in the form.
Once I submit, I want to get 'total1' and 'total2' where
total1 is the sum of the two fields and total2 is the
multiplication of the two fields.
I have created the two hidden fields 'total1'
and 'total2' in the form and added them to the
confirmation page. Do I just write the code below two
times? - like this? - I have tried this and I get one
total but not the other:
onclick="this.form.total1.value = parseInt
(this.form.field1.value) + parseInt
(this.form.field2.value);return true;"
onclick="this.form.total2.value = parseInt
(this.form.field1.value) * parseInt
(this.form.field2.value);return true;"
do I need to put some kind of sign in between?
thanks in advance
Penelope
___________
Try changing the formula to:
onclick="this.form.total.value = (this.form.field1.value-
0) + (this.form.field2.value-0);return true;"
Or
onclick="this.form.total.value = parseInt
(this.form.field1.value) + parseInt
(this.form.field2.value);return true;"
--
message | I am trying to add two form fields so the come up as a
| total in a confirmation page. I finally got the
| instructions on how to do it. I do the following
(below -
| also the whole chain of e-mails), but in the
confirmation
| page I do not get the addition but instead one number
| after the other (ex: if I add 4 + 5 I get 45 and not 9).
| If I change the sign on the event handler from an
| addition (+) to a multiplication (*) it works well (ex:
| if I multiply 4 * 5 I get 20)
|
|
| Any ideas on what may happen?
|
| _____________This is what I do_______
| add an onclick event handler
| onclick="this.form.total.value =
this.form.field1.value
| + this.form.field2.value;return true;"
|
| where field1 and field2 are the 2 field names of the
| fields you want to total
|
| Create a hidden form field for the total and add that
| field to your confirmation page
|
| _______This is the whole chain of E-mails________
|
| Subject: Re: need to do math in a form with fp2002
| From: "Stefan B Rusynko" <[email protected]> Sent:
| 8/10/2003 3:26:19 AM
|
|
|
|
| Create a hidden form field for the total and add that
| field to your confirmation page
| In the form, right click | Form Properties | Advanced |
| Add | Name the field (say total) and give it a value
(say
| 0).
|
| In the submit button add an onclick event handler
| onclick="this.form.total.value =
this.form.field1.value
| + this.form.field2.value;return true;"
|
| where field1 and field2 are the 2 field names of the
| fields you want to total
|
| PS use validation to make sure Fields 1 & 2 are required
| fields
| --
| _____________________________________________
| SBR @ ENJOY (-: [ Microsoft MVP -
FrontPage ]
| "Warning - Using the F1 Key will not break anything!"
(-;
| To find the best Newsgroup for FrontPage support see:
| http://www.net-sites.com/sitebuilder/newsgroups.asp
| _____________________________________________
|
|
| message | | I need help with the following task:
| |
| | I have a page where there is a form. Two field in that
| | form require that you input a number. Once you click
| | submit, all the data in the form, gets sent to a
| | database. You then get a customized confirmation page
| | where you see the data that you have entered in the
| | database.
| |
| | Also, I need to display a total, which is the sum of
the
| | two number entered in the form and into the database.
| |
| | Any ideas?
| |
| | Thanks,
| |
| | Regards
|
|
...
..