Expand my Community achievements bar.

SOLVED

Problem with "if" expression

Avatar

Level 1

I'm creating a form in which I'm comparing a numeric field with a numeric value typed in it using the expression "if" (I'm using FormCalc language) in order to generate another numeric value automatically in another NumericField , the script goes like this:

if (NumericField1 ==1) then

     NumericField6 = 100

endif

I type this script in NumericField6 and I used the script check option and marks no errors in the script but when I use Acrobat to test the form (typing "1" in NumericField1) it doesn't generate automatically the 100 value in NumericField6. Can someone help me telling me why the script is not working? or how can I do to generate a numeric value in another NumericField depending of the numeric value typed in a previous Field?

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 8

You need to compare the value of your numeric field and not the field itself:

if (NumericField1.rawValue ==1){

     NumericField6.rawValue = 100

}

View solution in original post

2 Replies

Avatar

Correct answer by
Level 8

You need to compare the value of your numeric field and not the field itself:

if (NumericField1.rawValue ==1){

     NumericField6.rawValue = 100

}

Avatar

Level 1

Dude. thanks a lot !!!!!, you have no idea how many days I have been trying to do this form to work, again thanks!