Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Check Boxes In Adobe using JavaScript?

Status
Not open for further replies.

Rainman1234

Programmer
Nov 9, 2004
15
US
Hello All!

I am creating a form. (Atleast trying too!) On one spot on the form I have check boxes. You have 6 selections, but you can only choose 1. You also have 13 lines. On the 14th line they want the totals for the check boxes selected. I have exported all the values 1 through 6. (Column 1 = 1, Column 2 = 2 ...)I am having difficulty with the syntax. I have never used JavaScript before.
Here is my code so far:

<script>
function calculate(injuryTotals) {
if line1M.value = 1 {
TotalM1.value = TotalM1.value + 1 }
if line2M.value = 1 {
TotalM1.value = TotalM1.value + 1 }
if line3M.value = 1 {
TotalM1.value TotalM1.value + 1 }
if line4M.value = 1 {
TotalM1.value TotalM1.value + 1 }
if line5M.value = 1 {
TotalM1.value TotalM1.value + 1 }
if line6M.value = 1 {
TotalM1.value TotalM1.value + 1 }
if line7M.value = 1 {
TotalM1.value TotalM1.value + 1 }
if line8M.value = 1 {
TotalM1.value TotalM1.value + 1 }
if line9M.value = 1 {
TotalM1.value TotalM1.value + 1 }
if line10M.value = 1 {
TotalM1.value TotalM1.value + 1 }
if line11M.value = 1 {
TotalM1.value TotalM1.value + 1 }
if line12M.value = 1 {
TotalM1.value TotalM1.value + 1 }
if line13M.value = 1 {
TotalM1.value TotalM1.value + 1 }
}
</script>



'I would do the above code for colums 1-6 and lines 1-13.

I appreciate all inputs!

Thanks,

Rainman1234
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top