Highlighted

Populating Text Field from Multi Checkboxes

mkaylah21

04-01-2012

Need help with formula.  Not sure whether or not I should be using FormCalc or Javascript as I am not extremely familiar with either.  I have a form that has three checkboxes (Box1, Box2, & Box3) that need to auto populate a text field (EmpAck).  I have tried three different ways to get this done and none are working for me.  What I need to happen is if "Box1" is checked "Text1" is inserted in "EmpAck" field and if "Box2" is checked "Text2" is instered & so on.  The texts are never the same and never added together.  I have set "EmpAck" to be read only, allowing multiple lines, and have the "Expand to fit box marked as the texts' are different lengths.  Any help would be great.

1. // This would go in the Textfield under calulate using FormCalc

if (Box1 = "On") then

EmpAck = "Text1"

elseif (Box2 = "On") then
EmpAck = "Text2"

elseif (Box3 = "On") then

EmpAck = "Text3"

endif

2. //This would go in the checkbox "Box1" changing "Text1" to "Text2" or "Text3" as required under mouseup using JavaScript (found under http://forums.adobe.com/message/2489082#2489082)

if (this.rawValue == 1)

{EmpAck.rawValue = "Text1";}

else {EmpAck.raqValue = " ";}

3.//This would go in textfield under calcuate using JavaScript (found under http://forums.adobe.com/message/4108395#4108395)

var a =" "

if (this.getField(Box1).value == "Yes")

{a="Text1"}

if (this.getField(Box2).value == "Yes")

{a="Text2"}

if (this.getField(Box3).value == "Yes")

{a="Text3"}

event.value=a

Replies