WordPress.org

Ready to get started?Download WordPress

Forums

WordPress-to-lead for Salesforce CRM
[resolved] Pre-checked checkbox (19 posts)

  1. groomedmonkey
    Member
    Posted 6 months ago #

    Is there a way to have a checkbox field pre-checked?

    Also the markup for checkboxes in the form seems to vary. The "Send me a copy" has the <input> within the <label> whereas a field checkbox has them separate.

    http://wordpress.org/plugins/salesforce-wordpress-to-lead/

  2. groomedmonkey
    Member
    Posted 6 months ago #

    Hmm ok, so if you don't enter anything in the "Value" field then it is checked by default... I guess my question should be amended to "how do you control whether a checkbox is checked or not" as it seems a bit trial-and-error.

  3. groomedmonkey
    Member
    Posted 6 months ago #

    Ok, I believe this logic is handled by Salesforce (Setup > Customize > Leads > Fields > Edit the field that is a checkbox > Default value) so I am marking this as resolved.

  4. Nick Ciske
    Member
    Plugin Author

    Posted 6 months ago #

    "Send me a copy" is output separately from the form HTML.

    A checkbox should always have a value defined (or why bother having it?). The value is only sent if the user checks the checkbox, otherwise an empty string is sent.

  5. groomedmonkey
    Member
    Posted 6 months ago #

    Ok, that solves my other issue of the checkbox not sending data but if I add a value to it in WordPress-to-Lead it ignores the pre-checked condition set in Salesforce for that field.

    It is a "I would like to receive correspondence" checkbox and should be checked by default.

    p.s. sorry for two support posts, initially I thought they were two separate issues.

  6. Nick Ciske
    Member
    Plugin Author

    Posted 6 months ago #

    Pre-checked checkboxes (aka default value) aren't supported in the plugin, yet. Checkboxes are fairly new and came from a fork, so I hadn’t given them much attention beyond merging in the changes.

    Pre-checked checkboxes are generally to be avoided as they require the user to opt-out vs. opt-in, but I can see how the feature could be useful in some cases. I've added it to the next release feature list.

  7. Nick Ciske
    Member
    Plugin Author

    Posted 6 months ago #

    Just a note: the reason this hasn’t been implemented yet is it requires some updates to the admin UI to add another "default" field for checkboxes.

    So it'll happen, but probably not until 2.3.

  8. groomedmonkey
    Member
    Posted 6 months ago #

    Hey Nick, thanks for following up so awesomely!

    What is very strange then is I am seeing my checkbox checked by default if I don't specify a value in the plugin - so it seems to be reading the settings partially from Salesforce. As soon as I add a value (so data is actually sent!) the checkbox is unchecked by default.

  9. Nick Ciske
    Member
    Plugin Author

    Posted 6 months ago #

    Yeah, if you don't enter a value, nothing gets sent for that field, and SalesForce's default takes effect.

    If you do enter a value, the plugin sends data (null or the value) which seems to cause SF not to use the default value set in its end.

    I'm not sure if changing then plugin to not send anything if the checkbox is not checked would work at this point as it may break other sites that depend on the current behavior.

  10. cindybou
    Member
    Posted 3 months ago #

    I am having a problem with checkboxes. They are all appearing on the form as checked. I have entered a label, but do not have a value in the value field. Shouldn't these been unchecked?

    Help!

    Cindy

  11. Nick Ciske
    Member
    Plugin Author

    Posted 3 months ago #

    Checkboxes have to have a value, even if all it is is 1.

    No value means... nothing which matches nothing, which is why they are checked. No value means it won't transfer to Salesforce either.

  12. cindybou
    Member
    Posted 3 months ago #

    I'm a little confused. I put a value of 1 in all the checkbox fields, but they are still all checked on the form.

    Example

    40lk_c "Enabled" Checkbox (field type) 401k (label) 1 (value)

    What am I doing wrong?

  13. cindybou
    Member
    Posted 3 months ago #

    Additionally, the form is no longer submitting. I cleared cache in browser too.

  14. Nick Ciske
    Member
    Plugin Author

    Posted 3 months ago #

    Can you posts screenshot of your form settings and a link to a form I can look at?

  15. cindybou
    Member
    Posted 3 months ago #

    Here is the link to the form.

    http://www.painlesshire.com/questionnaire-test/

    Not sure how I attach a file here. Don't see an option. Am I missing it?

  16. Nick Ciske
    Member
    Plugin Author

    Posted 3 months ago #

    Those checkboxes do not have a value set - so you're either entering that in the wrong field... or have discovered a new bug.

    <input type="checkbox" id="sf_X401k__c" class="w2linput checkbox" name="X401k__c" value="" checked="checked">

    value="" = no value set...

    But I can't know for sure until I see your settings page so I can try to duplicate the issue.

    You can't attach files -- you need to upload it to a photo sharing service (like http://tinypic.com) and include the link.

  17. cindybou
    Member
    Posted 3 months ago #

    Here is the link to screenshots.

    https://www.dropbox.com/sh/jgyjdy9o7vjnyk6/lSdxjsIfUN

    Thanks!

  18. Nick Ciske
    Member
    Plugin Author

    Posted 3 months ago #

    Ah, it's a visual bug.

    The Value field is the text box below the Label field.

    The larger text area is the Options field (for dropdowns).

    An Admin UI refresh is high on the todo list!

  19. cindybou
    Member
    Posted 3 months ago #

    Ah! Glad it was something simple. Will make the changes and see if the form submits now.

    Thank you!!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.