Multiple condition If and statement | Community
Skip to main content
ParreLaws
Level 3
March 8, 2012
Solved

Multiple condition If and statement

  • March 8, 2012
  • 3 replies
  • 6819 views

I am using the if statement below on a button. What I would like to happen is if Name, Address, City, State, Zip and Member (fields) are empty you get the message Please complete all required fields or if the Member(field) (which is a yes=1, no=2) radio button equal 1 and eitehr Class, Room, Return or Local are empty you will get that same message. But if either of these conditions are met then it clicks the printbutton1.

if ((Name.rawValue == null) or

    (Address.rawValue == null) or

    (City.rawValue == null) or

    (State.rawValue == null) or

    (Zip.rawValue == null) or

    (Member.rawValue == null) or

then

xfa.host.messageBox("Please complete all required fields to print.")

elseif

    (Member.rawValue == 1) and

    (Class.rawValue == null) or

    (Room.rawValue == null) or

    (Return.rawValue == null) or)

    (Local.rawValue == null))

   

then

xfa.host.messageBox("Please complete all required fields to print.")

else

PrintButton1.execEvent("click")

endif

Any assistance would be greatly appreciated.

Thanks

Parre

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by whyisthisme

Try this (in formcalc):

if ((Name.isNull or Address.isNull or City.isNull or Zip.isNull or State.isNull or Member.isNull) or (Member == 1 and (Class.isNull or Room.isNull or Local.isNull))) then

    xfa.host.messageBox("Please complete all required fields to print.")

else

    PrintButton1.execEvent("click")

endif

3 replies

whyisthisme
whyisthismeAccepted solution
Level 8
March 9, 2012

Try this (in formcalc):

if ((Name.isNull or Address.isNull or City.isNull or Zip.isNull or State.isNull or Member.isNull) or (Member == 1 and (Class.isNull or Room.isNull or Local.isNull))) then

    xfa.host.messageBox("Please complete all required fields to print.")

else

    PrintButton1.execEvent("click")

endif

ParreLaws
ParreLawsAuthor
Level 3
March 9, 2012

Thank you so much this worked great.

December 11, 2017

Hi

I need to put two conditions in my PAGINATION TAB of my sub form .

suppose vendor is not equal to previous vendor OR

              currency is not equal to previous curr . so it has to go and print in new page .

If i put one condition it is working fine but i want to check two condition how to write .

thanks

kiran