I have a FormCalc script that checks to see if TextField1 == TextField 2 and if it does then set a value of 1, if they're not equal, then 0.
However, the form is setting the value to 1 even though there is no entry in either field. I'm thinking I need to include an expression in the formula that says if the fields are null don't set a value. I'm not sure how to do this. Can someone help?
Thanks,
MDawn
Solved! Go to Solution.
Views
Replies
Total Likes
replace "!=" with "ne" in your code..
!= is a javascript notation.
ne is a FormCalc notation..
Thanks
Srini
Views
Replies
Total Likes
What does your code look like?
Paul
Views
Replies
Total Likes
if
(form1.page16c.Table1.Row1.posPrice10 == form1.page16c.Table1.Row1.shelfPrice10) then
1
else
0
endif
Margaret Dawn
Supervisor - Documentation
W: 630-850-1065
Views
Replies
Total Likes
You can check to see if the field is Not null and it equals the other field. Something like this:
if ((form1.page16c.Table1.Row1.posPrice10 == form1.page16c.Table1.Row1.shelfPrice10) & (form1.page16c.Table1.Row1.posPrice10 != null)) then
1
else
0
endif
This will mean that the field form1.page16c.Table1.Row1.posPrice10 must not be null and equal to the other field before a 1 will be placed in the field. Otherwise a 0 will be placed in the field.
Paul
Thank you. I'll try this.
Margaret Dawn
Supervisor - Documentation
W: 630-850-1065
Views
Replies
Total Likes
I'm getting a "syntax error near token ! on line..."
Margaret Dawn
Supervisor - Documentation
W: 630-850-1065
Views
Replies
Total Likes
replace "!=" with "ne" in your code..
!= is a javascript notation.
ne is a FormCalc notation..
Thanks
Srini
Views
Replies
Total Likes
Got it. Thanks.
Margaret Dawn
Supervisor - Documentation
W: 630-850-1065
Views
Replies
Total Likes
Now it doesn't like the &
Margaret Dawn
Supervisor - Documentation
W: 630-850-1065
Views
Replies
Total Likes
I figured it out. Thanks.
Margaret Dawn
Supervisor - Documentation
W: 630-850-1065
Views
Replies
Total Likes
Views
Likes
Replies