• Resolved blacklp

    (@blacklp)


    Due to the code in newsletter/subscription/validate.js it is not possible to use checkboxes in custom forms. The function newsletter_check_field insists that all checkboxes must be ticked!

    I have modified the code as follows, commenting out lines 3 to 6:

    function newsletter_check_field(field, message) {
        if (!field) return true;
        // if (field.type == "checkbox" && !field.checked) {
        //     alert(message);
        //     return false;
        // }
            
        if (field.required !== undefined && field.required !== false && field.value == "") {
            alert(message);
            return false;
        }
        return true;
    }

    but I’m not sure whether this will affect the operation of anything else in the plugin.

    Could you please:

    1. confirm whether my changes will cause problems;
    2. consider changing your code to allow the use of checkboxes.
    3. Thanks,
      Peter

Viewing 1 replies (of 1 total)
  • Plugin Author Stefano Lissa

    (@satollo)

    Hi, that check should be applied only to “extra profile fields” of type “checkbox”. If you set them, on subscription form fields pages to be mandatory, that check verify even your custom form.

    But you can/should avoid to call the newsletter_check() JS function for a custom form and code you’re own checks.

    Stefano.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom forms – unable to use checkboxes’ is closed to new replies.