Documentos de Académico
Documentos de Profesional
Documentos de Cultura
466 Views 4 Replies Latest reply: Cat286, May 30, 2012 3:09 PM
Replies
1. GKaiseril,
May 30, 2012 8:24 AM in reply to Cat286 Report
Have you accounted for the situation where any one or more of the items are not selected? Unselected check boxes have a value of "Off" and drop boxes for a blank or space value is a space.
| Mark as:
2. Cat286,
May 30, 2012 1:51 PM in reply to GKaiseril Report
Hmmm??? I think the simple answer to that is no! The drop box is a required field and can only select Yes or No. I am not sure what to do about the check boxes being off - doesn't this mean they just won't add if they are not checked? I am a complete novice when it comes to Javascript. How I wish it was as straightforward as Excel!
| Mark as:
3. GKaiseril,
May 30, 2012 2:42 PM in reply to Cat286 Report
Because of the fact that you want to add a constant to a number of values if a given condition is meet then you will need to use a custom calculation script. // get the value of the fields var cMember = Number(this.getField("Member").value); var nDay1 = this.getField("Day1").value; var nDay2 = this.getField("Day2").value; var nDinner = this.getField("Dinner").value; // define a varaiable for the sum var sum = 0; // day 1 plus adjustement if (nDay1 != "Off") sum += Number(nDay1) + cMember; // day 2 plus adjustement if ( Day2 != "Off") sum += Number(nDay2) + cMember; // dinner plus adjustement if (nDinner != "Off") sum += Number(nDinner) + cMember; event.value = sum; Excel is only easy if you accept Microsoft's view of calculations.
4. Cat286,
May 30, 2012 3:09 PM in reply to GKaiseril Report
Thanks so much. I would never have got that to work without your help. May you be forever blessed with health, wealth and happiness.
| Mark as:
Jive Software