计算字段 [英] Calculated fields
问题描述
我对JavaScript一无所知,但我被告知需要JavaScrip
才能解决我的Form问题。我试图找出如何获得2个列表字段,这些字段有文本名称,但代表
数值并计算它们。
First List字段将是这样的:
示例1:
< option> Sponsor One< / option> ; (这将代表一个数字值
$ 40.00)
< option> Sponsor Two< / option> (这将代表一个数字值
$ 25.00)
< option> Sponsor Three< / option> (这将代表一个数字值
$ 10.00)
然后会有第二个List字段,如例2所示
示例2:
< option> 1 Month< / option> (这将代表一个数值o
1)
< option> 2个月< / option> (这将代表数值o
2)
< option> 3个月< / option> (这将代表一个数值o
3)
然后我想将所选项目的数值乘以$
第一个List字段,按
第二个List字段中所选项的数值,并将结果放入名为?Price的文本字段中。
我希望结果会自动显示在Price fiel
中,只要选择了两个项目,你就需要点击一个按钮。
必须点击一个按钮。
这有多难?
谢谢
Joh
John
I know absolutely nothing about JavaScript but I am told that JavaScrip
is needed to solve my Form problem. I?m trying to figure out how t
take 2 List fields that would have text names but would represen
numeric values and calculate them..
First List field would be like this:
Example 1:
<option>Sponsor One</option> (This would represent a numeric valu
of $40.00)
<option>Sponsor Two</option> (This would represent a numeric valu
of $25.00)
<option>Sponsor Three</option> (This would represent a numeric valu
of $10.00)
Then there would be a second List field as in Example 2
Example 2:
<option>1 Month</option> (This would represent a numeric value o
1)
<option>2 Months</option> (This would represent a numeric value o
2)
<option>3 Months</option> (This would represent a numeric value o
3)
Then I would like to multiply the numeric value of the selected item i
the first List field by the numeric value of the selected item in th
second List field and put the result into a text field called ?Price?.
I would like to have the result appear in the Price fiel
automatically, as soon as the two items have been selected, withou
having to click on a button.
How difficult is this?
Thanks
Joh
John
推荐答案
40.00)
< option> Sponsor Two< / option> (这将代表一个数字值
40.00)
<option>Sponsor Two</option> (This would represent a numeric valu
of
25.00)
< option> Sponsor Three< / option> (这将代表一个数字值
25.00)
<option>Sponsor Three</option> (This would represent a numeric valu
of
10.00)
然后会有第二个List字段作为在示例2中
示例2:
< option> 1 Month< / option> (这将代表一个数值o
1)
< option> 2个月< / option> (这将代表数值o
2)
< option> 3个月< / option> (这将代表一个数值o
3)
然后我想将所选项目的数值乘以$
第一个List字段,按
第二个List字段中所选项的数值,并将结果放入名为?Price的文本字段中。
我希望结果会自动显示在Price fiel
中,只要选择了两个项目,你就需要点击一个按钮。
必须点击一个按钮。
这有多难?
谢谢
Joh
$ b $约翰
10.00)
Then there would be a second List field as in Example 2
Example 2:
<option>1 Month</option> (This would represent a numeric value o
1)
<option>2 Months</option> (This would represent a numeric value o
2)
<option>3 Months</option> (This would represent a numeric value o
3)
Then I would like to multiply the numeric value of the selected item i
the first List field by the numeric value of the selected item in th
second List field and put the result into a text field called ?Price?.
I would like to have the result appear in the Price fiel
automatically, as soon as the two items have been selected, withou
having to click on a button.
How difficult is this?
Thanks
Joh
John
这篇关于计算字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!