I have this fieldset on my page which uses SLDS design:
<apex:pageBlockSection columns="2" id="ppCard">
<apex:repeat value="{!$ObjectType.my_Object__c.FieldSets.myFieldset}" var="ap1">
<apex:inputField value="{!ps[ap1.fieldPath]}"
styleClass="{! IF((ap1.fieldPath == 'field1'), 'fieldValue1', '')}
{! IF((ap1.fieldPath == 'field2'), 'fieldValue2', '')} inputfield"
label="{! IF((ap1.fieldPath == 'field1'), ap1.label+' (without Salutation)', ap1.label)}"
required="{!OR(ap1.required, ap1.dbrequired)}"/>
</apex:repeat>
If a field is required on fieldset definition, I would like its inputfield to be red also on page load. How can I get the specific field to be able to change its required attribute? For now, I am just making all inputfields required on page but not on the field set definition. I want to make it required only if it is also required on fieldset. Is there any way on how to do it?
For example: if field2 is the only field required on fieldset, I want to remove also the required attribute of field1 on page. Like using $('.samplestyleclass').val('').removeAttr('required')
on JS for example... Is it possible?