function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MelissaCMelissaC 

help: web to lead code to uncheck a checkbox

Hi - I'd really appreciate some direction on a custom code question that should be easy but has me stumped.

On our web to lead forms, I would like to have the form have a check box that is checked to receive more info from my company and if they uncheck it, it would then check the Email Opt Out field on the lead. So it would be reversed, when checked, Email Opt Out is unchecked and vice versa.

Here is the code I have to add the check box:

<td width="182"><input id="emailOptOut" name="emailOptOut" type="checkbox" checked="checked" value="1" /><label for="emailOptOut"><span class="style10">I would like to receive information and news communications from eStara in the future.</span></label></td>

I have tried to change the Value to "0", to "False" and to "No". Is it not possible to do this and if it is possible, how do I need to alter the code to reflect this?

Thanks in advance!

Best Answer chosen by Admin (Salesforce Developers) 
TCAdminTCAdmin

Melissa,

 

I don’t think that there is any way to make the checkbox work as you want.  I think that the only way to do something like this would be with a Workflow – Field Update.  If you have Enterprise Edition then you would create a custom checkbox field on Leads.  You won’t need it on the page layout but would want to have it visible to all users.  Then you can create a workflow rule that triggers whenever a lead is created and this custom field is FALSE.  A field update rule could then be used to update the standard Opt Out checkbox with a TRUE value.

 

If you don’t have Enterprise Edition then I don’t think it can be done like you want.

All Answers

TCAdminTCAdmin

Melissa,

 

I don’t think that there is any way to make the checkbox work as you want.  I think that the only way to do something like this would be with a Workflow – Field Update.  If you have Enterprise Edition then you would create a custom checkbox field on Leads.  You won’t need it on the page layout but would want to have it visible to all users.  Then you can create a workflow rule that triggers whenever a lead is created and this custom field is FALSE.  A field update rule could then be used to update the standard Opt Out checkbox with a TRUE value.

 

If you don’t have Enterprise Edition then I don’t think it can be done like you want.

This was selected as the best answer
MelissaCMelissaC
Thank you Chris! That is really helpful and a good, creative work-around which is just what I needed.  We do have Enterprise edition so I'm going to try to put this solution into play.  Thanks again - MC
KerryTKerryT

Hi

I have found a way of doing this thanks to some forum advice.

I did think about using the field update functionality but thought there would be come conflict as we needed to continue to use the Email Opt Out box for use with 3rd party bulk mailing software but use Email Opt In for web sign up. Directly linking Email Opt In to Email Opt Out meant the Email Opt In setting would automatically override Email Opt Out when the record is saved.

Let me know if you need anymore help with this.

Message Edited by Kingsley on 04-19-2007 03:24 PM