conditional validation on Biz-form

jack Ryder asked on March 3, 2014 06:39

hi all can any one help me in conditional validation in bizform Scenario is: ... i have make biz-form with 4 fields:Name,Email,Phone,Message all fields are required Email and Phone fields are shown to only public user authorized user can see only two fields (phone,message) .... question is : When i am logged in and gone through that form and submit phone and message i get message name and email is required...though it is not visible in form.... so can anyone help me to hide that validation message???

Recent Answers


Brenden Kehren answered on March 3, 2014 06:54 (last edited on December 10, 2019 02:30)

For the "Enabled" property check to see if they are authenticated by using the macro {% CMSContext.CurrentUser.IsAuthenticated |(identity)GlobalAdministrator%}

0 votesVote for this answer Mark as a Correct answer

Jan Hermann answered on March 3, 2014 07:18 (last edited on December 10, 2019 02:30)

Hello,

Or if you want to hide that field, yo can set to allow empty values, set the validation to contain at least one character .+ and set the same condition above to the Visible condition with the {%CurrentUser.Username|(identity)GlobalAdministrator%} to a default field.

Best regards, Jan Hermann

0 votesVote for this answer Mark as a Correct answer

jack Ryder answered on March 4, 2014 00:32

Thank you for reply ..i already hide two fields but validation are still fired... Question clarification 1)simply i have 4 fields:(Title,Message,Email,Mobile) 2)all fields are required 3)validation are there in all fields(*required) 4)authorized user can only see two field (Title,Message) other fields (Email,Mobile) is not visible to authorized User 5)public user can see all the fields

Work done: 1)authorized user can see only 2 fields( other 2 fields are hidden) 2)public user can see all fields

Problem: 1)when authorized user click on submit button after enter data in two fields (title .message) get error email and mobile is required though it is not visible fields are hidden and still validation are fired 2)public user can do operation properly

0 votesVote for this answer Mark as a Correct answer

Aasim Khan answered on July 7, 2015 22:26

Hello jack,

You can configure your custom fields in CMS. When you will click on any field, in the bottom of the page you will see 'Visibility Condition', here you can set the condition. For example for Email field (CurrentUser.UserName == "public")

Regards, Aasim Afridi

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.