• Resolved nate.ads

    (@nateads)


    I am trying to work up a submission to a non-supported CRM. But the checkboxes that use pipes to hide the checkbox value are submitting the user visible value not the hidden value to my CRM.

    My code is below
    Contact Form 7 Dashboard

    [checkbox hydration id:hydration class:check-boxes use_label_element "Select|hydrate"]

    PHP for CRM submission (cut down)

    var wpcf7Elm = document.querySelector( '.wpcf7' );

    wpcf7Elm.addEventListener( 'wpcf7submit', function( event ) {


    var hydrate = getArrayValue('hydration');

    var formData = {
    hydrate: hydrate,
    };
    $.ajax( {
    type: "POST",
    url: "https://xxx/crm.php",
    data: formData,
    } );
    }, false );

    This results in the CRM displaying the ‘Select’ value not the ‘hydrate’ value.

    • This topic was modified 1 year, 4 months ago by nate.ads.
    • This topic was modified 1 year, 4 months ago by nate.ads. Reason: Added to CRM submit code
    • This topic was modified 1 year, 4 months ago by nate.ads.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter nate.ads

    (@nateads)

    Is my request not possible to do?

    If so is there another method that can be used to assign a specific value to a checkbox that is different from the visible label? It doesn’t need to be hidden by the html in my use case.

    Thread Starter nate.ads

    (@nateads)

    Solved my own problem. Not sure if it’s an ideal solution but it works.

    Instead of trying to read the value after pipes I simply changed my checkbox to only have a value with no pipes

    [checkbox hydration id:hydration class:check-boxes use_label_element "hydrate"]

    Then I use CSS Psudeo elements to display something for the user to see in browser

    .check-boxes {
    font-size: 0.01rem;
    color: transparent;
    position: relative;
    }
    .check-boxes::before {
    content: 'Select';
    position: absolute;
    top: 0;
    left: 0;
    }

    I used this approach as I have custom checkboxes so I cannot use ‘display: none;’ for the .check-boxes class.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Get value from pipes’ is closed to new replies.