You need to sign in to do that
Don't have an account?
sdb
Referencing a field inside a fieldset?
I have a fieldset that encapsulates fields from Contact: salutation, firstName, middleName and lastName. The fieldset looks like this within my Visualforce page:
<apex:repeat value="{!$ObjectType.Contact.FieldSets.Personal_Information}" var="pi" >
<apex:inputField id="personalInfoContact" value="{!contact[pi]}" />
</apex:repeat>
I'd like to be able to reference the lastName field within the fieldset from JavaScript. Is there any way to get the id of a field within a fieldset?
Yes, it is possible. You can use it according to your requirement.
<apex:repeat value="{!$ObjectType.Contact.FieldSets.Personal_Information}" var="pi" >
<script>alert('{!pi}');</script>
<apex:inputField id="personalInfoContact" value="{!contact[pi]}" />
</apex:repeat>
Hi, thanks for your response. I tested with your approach, but it still appears that there is no way to determine the javascript id of a field inside a fieldset. I think that this is a limitation of field sets.
FieldSet works as a set of data instead of any visualforce tag, so can you please clear out your need .