Hi,
I'm using 'gform_pre_render' to do a lot of stuff on my forms. This is what I'm trying to achieve:
I have 20 fields (all set as required from back-end). I want to set only the first 5 fields as 'required' when the current user is administrator, and keep all of them required if the current user has some other custom role that I defined. Using the filter, I check the current_user_can('role') and set the 'isRequired' property as 1 or blank according to the role.
In the front end, when the form is rendered, I can see the asterisks disappeared for the fields I set as not-required through my code ( by setting 'isRequired' as blank ), but when I submit the form with them as empty, they still fail the validation and my form doesn't get submitted!
Is there any other parameter from the field object I need to disable? Please help me with this.
Thanks in advance!