Expand my Community achievements bar.

If statements????

Avatar

Former Community Member
Hi



Is it possible to have a field that triggers another field?



What I mean is:



Field One is a drop down list called "Machine" contents are 1, 2, & 3



Field Two is a number field called "Stretch"



If I enter "1" into field one then field two should then be 1.4%, if it's "2" then field two's answer is "3%" and so on.



Any ideas?
3 Replies

Avatar

Former Community Member
Try taking a look at the Livecycle help files. As useless as the documentation is for this software, there is sufficient help for if statements.



But to answer your question, yes, it is very possible to do what you want.

Avatar

Former Community Member
Thanks for that.



I have been trying a test and keep getting script failed error messages.



For the test I have created 3 fields:



NumericField1

NumericField2



NumericField3 = Script: Show = Calculate, Language = FormCalc, Run At = Client

if (NumericField1 = 3)then NumericField4 = 77

elseif (NumericField1 = 4)then NumericField4 = 88

endif



If I replace the If statement with a simple NumericField1 + NumericField2 it's fine.



Any ideas what's wrong?



Peter

Avatar

Former Community Member
Are you opposed to using JavaScript for any reason? If not, try this on the Exit event for NumericField 1:



if (NumericField1.rawValue == 3)

{

NumericField3.rawValue = 77

}

else if (NumericField1.rawValue == 4)

{

NumericField3.rawValue = 88

}