In the user registration form, I have set a certain field say surname as hidden i.e. I have unchecked the checkbox saying "Display on user registration form." as shown below:
Now I want to disable the server side validation for this field. When I print the $form
array, the surname field is still displayed. However I am not able to find any such value in the $form
array which checks if the value is unchecked or not. Is there any way to figure out if the said field is not displayed on the registration form? Hope I am clear enough.
#access
key on the element render array and it's children, that usually determines whether a field is going to be rendered or not