Rainman1234
Programmer
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
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