+ Start a Discussion
Dan GetmanDan Getman 

Visualforce Field Name Question

I want to add a new checkbox item to my company's Visualforce Donation page, but cannot find the appropriate fieldname or fieldvalue for the custom field I created.  How do I get that information so that the box registers properly when clicked on?

I have some, but limited, html knowledge, so I believe knowing how to find that value of my custom field is all I need to make this work.

Thank you!
daniel_hdaniel_h
Go to the field definition on the object and look at what the API name is. It should be something like My_Checkbox__c.

On your VF page, then add <apex:inputField value="{!Custom_Object__c.My_Checkbox__c}" />
Dan GetmanDan Getman
Thanks.  On the VF page, all the names/values are something like "FieldName2400."  Will this take the place of those numbered titles?
daniel_hdaniel_h
Hmm, that seems odd. Could you post a snippet of your VF page showing how some work now?
Dan GetmanDan Getman
User-added imageUser-added image

The code in the first image corresponds to the pageview on the second.  I'd like to create a simple checkbox for a new campaign we're using, but I don't want the collapsed section.  It needs to autofill the corresponding field though when checked True.
daniel_hdaniel_h
That isn't Visualforce. Is this a web to case form instead?
daniel_hdaniel_h
That isn't Visualforce. Is this a web to case form instead?
Dan GetmanDan Getman
User-added image
That's what it says here...
daniel_hdaniel_h
OK, so it is a Visualforce page, but that isn't Visualforce markup for the form. It is html inside a VF page. Since you don't have a controller on the page, there is no binding to fields the Visualforce way which is how I originally answered the question. I'm assuming there is some JavaScript doing the work for you. Any chance you can post the entire source? 
Dan GetmanDan Getman
<apex:page showHeader="false"  standardStylesheets="false"  >
    <apex:composition template="{!$Site.Template}">
        <apex:define name="body">
            <!-- Scripts and styles -->
        <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"/>
        <apex:includeScript value="{!$Resource.KELLValidationLibrary}"/>
        <script>
        j$(document).ready(function(){
        j$('#rightcol').prepend(j$('.nodepool .inside'));
        });
        </script>
        <style type="text/css">
        .inside{
            margin-top:76px;
            margin-bottom: 14px;
        }
        .inside h3{
            color: #00659d;
background: #f2c91f;
padding: 8px;
        }
        .inside p{
            padding: 8px;
            font-size: 0.9em;
            line-height: 1.4em;
            color: #444;
            background: #f4f4f4;
        }
            fieldset{
                padding:10px;
                margin-bottom: 10px;
                border:#ddd solid 1px;
                border-radius:9px;
            }
            legend{
                padding:0 10px;
                font-size: 1.15em;
            }
            div.formItem{
                margin-bottom:8px;
            }
            label{
                display: inline-block;
                width:150px;
                padding-right: 20px;
                text-align: right;
            }
            label.collapse{
                display: inline;
                padding-right: 20px;
                width:300px;
                text-align: left;
            }
            span.indent{
                padding-left:40px;
            }
            .inError{border:solid 1px #A00; background-color: #fbb;}
            .donateButton{                   
                    padding: 10px;
                    background: #f2c91f;
                    color: #00659d;
                    font-size: 15px;
                    font-weight:bold;
                    border: none;
                    border-radius: 6px;
            }
            .donateButton:hover{
            color:#fff;
            }
        </style>
        <div class="nodepool" style="display:none;">
            <div class="inside">
            <h3>
            Be a Champion of Nourishment
</h3>
<p>
Did you know? For every $25, MANNA can provide approximately 7 meals to one of our clients.
</p><p>
<b>You can provide more nourishment by becoming a MANNA Friend. MANNA Friends are donors who show their dedication to our mission through monthly giving. Please consider joining at one of the levels below. </b>  
 </p><p>
<b>MASTER CHEF</b> - $100/month
 </p><p>
<b>EXECUTIVE CHEF</b> - $75/month
 </p><p>
<b>SOUS CHEF</b> - $50/month
 </p><p>
<b>PRODUCTION CHEF</b> - $25/month
</p><p>
<b>STATION CHEF</b> - $15/month
 </p><p>           
</p>
 
            </div>
        </div>
        <form id="Donation" class="doValidate" method="post" action="https://faas.cloud.clickandpledge.com">
            <h2>Nourish Your Neighbors...Donate Now.</h2>
            <!-- hidden C&P Donation Fields -->
            <input name="ItemID1" type="hidden" id="ItemID1" value="1" />
            <input name="ItemName1" type="hidden" id="ItemName1" value="Donation" />
            <input name="SKU1" type="hidden" id="SKU1" value="DON" />
            <input name="Quantity1" type="hidden" id="Quantity1" value="1" />
            <!-- hidden C&P Redirect Fields -->
            <input type="hidden" name="OnSuccessUrl" id="OnSuccessUrl"  value="https://manna1.secure.force.com/donate/thanks" />
            <input type="hidden" name="OnDeclineUrl" id="OnDeclineUrl"  value="https://manna1.secure.force.com/donate/declined" />
            <input type="hidden" name="OnErrorUrl" id="OnErrorUrl"      value="https://manna1.secure.force.com/donate/error" />
            <!-- hidden C&P ACCOUNT Fields -->
            <input type="hidden" name="AccountGuid" id="AccountGuid" value="25300d58-165e-4464-a93b-97b5150c1241" />
            <input type="hidden" name="AccountID" id="AccountID" value="26988" />
            <input type="hidden" name="WID" id="WID" value="71210" />
            <!-- hidden C&P Reference Fields -->
            <input type="hidden" name="RefID" id="RefID" value="Website" />
            <input type="hidden" name="Tracker" id="Tracker" value="Website" />
            <!-- hidden C&P Form Method Fields -->
            <input type="hidden" name="SendReceipt" id="SendReceipt" value="False" />
            <input type="hidden" name="OrderMode" id="OrderMode" value="Production" />
                <!-- Order Mode can be Test or Production -->
          
            <input type="hidden" name="TransactionType" id="TransactionType" value="Payment" />
            <!-- hidden C&P Standardization Fields -->
            <input type="hidden" name="DecimalMark" id="DecimalMarkMode" value="US" />
            <input name="UnitDeductible1" type="hidden" id="UnitDeductible1" value="100%" /><fieldset><legend>Donation</legend> <div class="formItem">              
                    <div class="row">
                        <label>Amount: </label>
                        <input  id="UnitPrice1" name="UnitPrice1" type="radio" value="25" autocomplete="off" onClick='ClearText("#Other1");' />           
                        <label for="UnitPrice1" class="collapse">$25</label>
                    </div>
                </div>
                <div class="formItem">
                    <div class="row">
                        <label> </label>
                        <input id="UnitPrice2" name="UnitPrice1" type="radio" value="50"  autocomplete="off" onClick='ClearText("Other1");' />
                        <label for="UnitPrice2" class="collapse">$50</label>
                    </div>
                </div>
                <div class="formItem">
                    <div class="row">
                        <label> </label>
                        <input id="UnitPrice3" name="UnitPrice1" type="radio" value="100" autocomplete="off" onClick='ClearText("Other1");' />
                        <label for="UnitPrice3" class="collapse">$100</label>
                    </div>
                </div>
                <div class="formItem">
                    <div class="row">
                        <label> </label>
                        <input id="UnitPrice4" name="UnitPrice1" type="radio" value="250" autocomplete="off" onClick='ClearText("Other1");' />
                        <label for="UnitPrice4" class="collapse">$250</label>
                    </div>
                </div>
                <div class="formItem">
                    <div class="row">
                        <label> </label>
                        <input id="UnitPrice5" name="UnitPrice1" type="radio" value="Other" autocomplete="off" />       
                        Other (do not type $ sign): <input id="Other1" name="Other1" autocomplete="off" size="10" type="text" class="numberOnly" onchange="CleanNumberOnlyFields();" onclick='SetRadio("UnitPrice1","Other");'/>
                     
                    </div>
                </div><div class="formItem">
                    <label>Recurring:</label>
                    <label for="Single"  class="collapse">
                        <input name="Installment" type="radio" id="Single" value="" checked="checked" autocomplete="off" />
                        This is a one-time donation. 
                    </label>
                    <br/>
Dan GetmanDan Getman
<label></label>
                    <label for="Recurring" class="collapse" style="line-height:1.8em;">
                        <input type="radio" name="Installment" value="999" id="Recurring"  autocomplete="off" />
                       I want to join MANNA Friends monthly giving program ($15/month minimum) </label>
                    <br/><span style="padding-left:200px;">Pay every <select name="Periodicity" id="Periodicity"  autocomplete="off">
                             <option value="Month" selected="selected">Month</option>
                            <option value="2 Months">2 Months</option>
                            <option value="Quarter">Quarter</option>
                            <option value="6 Months">6 Months</option>
                            <option value="Year">Year</option>
                        </select></span>
 
                </div></fieldset><fieldset><legend>Personal Information</legend><div class="formItem">
    <label for="BillingFirstName">First Name:</label><input name="BillingFirstName" class="required" type="text" id="BillingFirstName" value="" size="30" />*
</div>
<div class="formItem">
    <label for="BillingLastName">Last Name:</label><input name="BillingLastName" class="required" type="text" id="BillingLastName" value="" size="30" />*
</div>
<div class="formItem">
    <label for="BillingPhone">Phone number:</label><input name="BillingPhone" type="text" id="BillingPhone" value="" size="30" />
</div>
<div class="formItem">
    <label for="BillingEmail">Email address:</label><input name="BillingEmail" class="required email" type="text" id="BillingEmail" value="" size="40" />*
</div>
<div class="formItem">
    <label for="FieldValue2100">Comments:</label><input name="FieldName2100" type="hidden" value="Comments"  autocomplete="off" /><input name="FieldValue2100" type="textarea" style="width:300px; height:40px;" autocomplete="off" />
</div><div class="formItem">
    <label for=""></label><input name="FieldName2400" type="hidden" value="GetNewsletter"  autocomplete="off" /><label class="collapse" for="FieldValue2400"><input name="FieldValue2400" type="checkbox" checked="checked" value="yes" autocomplete="off" /> I wish to receive e-mail updates.</label>
</div>
<div class="formItem"><input name="FieldName2200" type="hidden" value="Anonymous" autocomplete="off" />
    <label for=""></label><label class="collapse" for="FieldValue2200"><input name="FieldValue2200" type="checkbox" value="yes"  autocomplete="off" /> I wish to make this donation anonymously.</label>
</div>
<div class="formItem"><input name="FieldName2500" type="hidden" value="EmployerMatching"  autocomplete="off" />
    <label for="FieldValue2500">Employer Matching:</label><input name="FieldValue2500" type="text"  value="" autocomplete="off" />
    <div style="padding-left:170px;line-height: 1.3em;margin-top: 4px;font-size:0.9em;">If this gift is to be matched by your employer, please type the company name in the space above. You can send matching gift forms to dgetman@mannapa.org or 2323 Ranstead St. Philadelphia, PA 19103.</div>
</div>
<div class="formItem"><input name="FieldName27100" type="hidden" value="ResponseTo"  autocomplete="off" />
<label>Response To:</label>This donation is in response to <br/><label></label><select id="FieldValue27100" name="FieldValue27100" >
              <option value="" selected="selected"></option>
              <option value="Direct Mail">Direct Mail</option>
              <option value="E-newsletter">E-newsletter</option>
              <option value="Friend, Family or Colleague">Friend, Family or Colleague</option>
              <option value="Honor/Memorial">Honor/Memorial</option>
              <option value="I am a MANNA Volunteer">I am a MANNA Volunteer</option>
              <option value="MANNA Website">MANNA Website</option>
              <option value="Newspaper article">Newspaper article</option>
              <option value="Print NOURISH Newsletter">Print NOURISH Newsletter</option>
              <option value="Social Media (Facebook, Twitter, etc.)">Social Media (Facebook, Twitter, etc.)</option>
              <option value="Telephone Call">Telephone Call</option>
              <option value="TV or Radio Program">TV or Radio Program</option>
              <option value="Other: Please enter in description below">Other: Please enter in description below</option>
          </select>
</div>
<div class="formItem"><input name="FieldName27101" type="hidden" value="ResponseToOther"  autocomplete="off" />
<label></label>Other:<input id="FieldValue27101" type="text" name="FieldValue27101" />
    </div>         
</fieldset><fieldset>
    <legend>Honor / Memorial</legend>
    <div class="formItem">
        <label></label>
        <label class="collapse">
            <input id="showMemCheckbox" onchange="ShowBlock(this.id, 'memorial');" type="checkbox" autocomplete="off" value="yes"/> This donation is in honor/memorial of someone.
        </label>
    </div>
    <div id="memorial" style="display: none;">
        <div class="formItem"><input name="FieldName3300" type="hidden" value="HonorType"/>
            <label for="FieldValue3300">This donation is:</label>
            <select name="FieldValue3300">
                 <option value=" ">- Select -</option>
                <option value="Memorial">In memory of someone</option>
                <option value="Honor">In honor of someone</option>
            </select>
        </div>
        <div class="formItem"><input name="FieldName3301" type="hidden" value="Honoree"/>
            <label for="FieldValue3301">Honoree/Memorial Name:</label><input name="FieldValue3301" size="40" type="text"/>
        </div>
        <div class="formItem"><input name="FieldName3302" type="hidden" value="Notify"/>
            <label for="FieldValue3302">Person to Notify:</label><input name="FieldValue3302" size="40" type="text"/>
        </div>
        <div class="formItem">
           
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tbody>
                    <tr valign="top">
                        <td style="width:150px">
                            <label for="FieldValue3303">Address:</label>
                        </td>
                        <td><input name="FieldName3303" type="hidden" value="HonorAddress"/>
                            <textarea name="FieldValue3303" style="width:270px; height:50px;"></textarea>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="formItem">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tbody>
                    <tr valign="top">
Dan GetmanDan Getman
There's more, but the rest is mostly country names, so not sure how much you need.
daniel_hdaniel_h
Ah ha! The form is posting to 
<form id="Donation" class="doValidate" method="post" action="https://faas.cloud.clickandpledge.com">. I don't have an understanding of how Click and Pledge works, but you may need to talk to them about how to map a new field.
Dan GetmanDan Getman
Oh ok, thank you!  I figured I'd start here first since I wasn't sure.