I have an issue that I think I am over complicating. I have a table of Contacts. I need to select a Contact and grab their mobile phone number. I have tried everything from visualforce remoting to jQuery to sforce.apex.execute. I don't want to set the checkbox to a custom field value of Contact. Am I over complicating this? Is there a simple way to check a checkbox and grab the user data? Text() was the function I was using for my apex remoting attempts.

<apex:page standardController="Account">
   <apex:pageBlock >
        <apex:pageBlockSection columns="6" title="Select Contacts: ">
            <apex:pageBlockTable value="{!Account.Contacts}" var="con">
                <apex:column ><apex:inputCheckbox id="looped" onclick="uncheckOthers(this);" /></apex:column>
                <apex:column headerValue="Name" value="{!con.Name}" />
                <apex:column headerValue="Mobile Number" value="{!con.MobilePhone}" />
                <apex:column headerValue="Opted-In"><apex:inputCheckbox value="{!con.SMS_Opt_In__c}" disabled="true"/></apex:column>
                <apex:column headerValue="Opted-Out"><apex:inputCheckbox value="{!con.SMS_Opt_Out__c}" disabled="true"/></apex:column>
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton value="Select" onClick="text()"/>

1 Answer 1


You could have a function and during onclick pass mobilePhone value

<apex:inputCheckbox id="looped" onclick="selectContact(this, '{!con.MobilePhone}');" />
  • So much easier. Thank you! I was banging my head against the wall on this one.
    – Olivia
    Aug 15, 2017 at 20:43
  • that's why members are here. Aug 15, 2017 at 20:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .