Hi All, I created a form in Acrobat which had a radio button which if one value was selected it asked for value for another text field. If when this form was printed it checked to see if this the radio button was 1 and the text field was empty or null. If so it prompted the used for a value, if they still did not give a value it replaced the first page of the form with a template. This was a way to prevent printing the form without completeing the form correctly. I have since moved the form to Lifecycle designer and modified the code to perform the same steps except I have a text box which is invisible instead of the template. However I cannot get the conditions to work
Javascript on PrePrint
if (TextField1.rawValue= " " || TextField1.rawValue= null + RadioButtonList = 1)
xfa.host.messageBox("value is empty Print")
else
xfa.host.messageBox(" go ahead to print")
in The Java Debugger I see this
invalid assignment left-hand side
1:XFA:form1[0]:#subform[0]:Button1[0]:click
Any help would be appreciated
>1:XFA:form1[0]:#subform[0]:Button1[0]:clickThis refers to the line:
if (TextField1.rawValue= " " || TextField1.rawValue= null + RadioButtonList = 1)
And the message is talking about an assignment or setting a variable to a provided value. I think you want to compare a variable to a provided value. In JavaScript "=" is the assignment or set operator and not one of the equality operator, which are '==' and '==='. You probably want to use the less strict '==' equality operator. Also you might have problems using the "+' or additive operator for the "&" logical AND operator. And since you are writing a compound logical statement it would also be advisable to group the conditions with parenthesis to make sure they are interpreted in the correct order.HTH
George Kaiser