Forum Replies Created

Viewing 15 replies - 1 through 15 (of 39 total)
  • Thread Starter nate.ads

    (@nateads)

    @msaari That did it, thank you so much!

    hhmm the fact that it sends to email but doesn’t post a response is odd. I see 4 errors in your console are you able to post screen shots of what the last error is and also the code for your opening form tag after submitting?
    (e.g.)

    <form action="/contact/#wpcf7-f5-o1" method="post" class="wpcf7-form sent" aria-label="Contact form" novalidate="novalidate" data-status="sent">

    @ispacecrusader It’s the ‘=’ in placeholder you need a space not an equal sign. So your code should be

    <label class="form-field">
    [text* your-name placeholder "Naam"]</label>

    <label class="form-field">
    [email* your-email placeholder "E-mail adres"] </label>

    <label class="form-field">
    [text your-phone placeholder "Telefoonnummer"] </label>

    <label class="form-field">
    [text company-name placeholder "Bedrijfsnaam - functie"] </label>

    <label class="form-field">
    [textarea your-message placeholder "Jouw vraag"] </label>

    That’s why your textarea field works and the rest don’t because in your textarea field you used a space not an equal sign.

    • This reply was modified 1 year, 4 months ago by nate.ads.
    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.

    @ispacecrusader it looks like you’re not using the placeholder text correctly. Are you using it as follows?

    placeholder "placeholder text here"

    In Chrome Inspector it looks to be used as a value

    value="Naam"

    So you might just be missing the ‘placeholder’ tag before your text.

    @humpyers submit your form, then either right click the page and select ‘Inspect’ or use ‘Crtl + Shift + I’ your developer panel will open, in the developer panel hit ‘Ctrl + F’ and search for ‘sent’.

    If it’s working properly you should see a new class ‘sent’ added to your <form> tag and your ‘data-status’ similar to the below.

    <form action="/contact/#wpcf7-f5-o1" method="post" class="wpcf7-form sent" aria-label="Contact form" novalidate="novalidate" data-status="sent">

    Also look for this tag at the end of your form, this displays the message for the user to see (either error or confirmation).

    <div class="wpcf7-response-output" aria-hidden="true">

    • This reply was modified 1 year, 4 months ago by nate.ads.
    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.

    @div123 each required field will get the class ‘wpcf7-not-valid’ if it doesn’t pass validation on submit. So I basically throw anything in my CSS to highlight such as

    .wpcf7-not-valid {
    border: 2px solid red;
    }

    But you can really go crazy with creativity and highlight it tons of different ways since it gets a specific class added to it when it fails validation.

    • This reply was modified 1 year, 4 months ago by nate.ads.

    @juliamb I used jQuery to do something slightly similar I think. I used it to disable and enable my submit button only after a specific field was filled.

    Not sure if this might help.

    jQuery(document).ready(() => {
    jQuery('.wpcf7-submit').attr("disabled", "disabled");
    jQuery("input[type=text]").keyup(onFormUpdate);
    })

    function onFormUpdate() {
    const fieldName = jQuery("#field_name").val();

    if (fieldName) {
    jQuery('.wpcf7-submit').removeAttr("disabled");
    } else {
    jQuery('.wpcf7-submit').attr("disabled", "disabled");
    }
    }

    @div123 Are you referring to having the field display something like a red outline showing the field was left empty?

    @humpyers in the browser developer panel does your form get the ‘sent’ class after submission?

    @tristankappel correct me if I’m wrong but by having ‘optional’ in your acceptance checkbox allows it to run as an optional input.

    If you remove ‘optional’ from it should that not disable your submit button until the user checks the box?

    Thread Starter nate.ads

    (@nateads)

    @takayukister sorry, I ended up looking into it and I can’t use <div> or <ul> inside a <label> by default. I should have looked into that before asking a question.

    So I ended up changing my markup

    Dashboard

    <label class="checks">
    <span class="heading">
    <span class="product-label">Product Label</span>
    <span class="info">Product Info</span>
    </span>
    <span class="product"><img src="https://biosteel.ca/cdn/shop/products/PDP-Image-1194px_1194x.png" alt="" /></span>
    <span class="product-details">
    <span class="dot">Detail One</span>
    <span class="dot">Detail Two</span>
    <span class="dot">Detail Three</span>
    </span>
    <span class="input">[checkbox hydration class:check-boxes use_label_element "Select|hydration"]</span>
    </label>

    Output

    <label class="checks">
    <span class="heading">
    <span class="product-label">Product Label</span>
    <span class="info">Product Info</span>
    </span>
    <span class="product"><img src="https://biosteel.ca/cdn/shop/products/PDP-Image-1194px_1194x.png" alt=""></span>
    <span class="product-details">
    <span class="dot">Detail One</span>
    <span class="dot">Detail Two</span>
    <span class="dot">Detail Three</span>
    </span>
    <span class="input"><span class="wpcf7-form-control-wrap" data-name="hydration"><span class="wpcf7-form-control wpcf7-checkbox check-boxes"><span class="wpcf7-list-item first last"><label><input type="checkbox" name="hydration[]" value="Select"><span class="wpcf7-list-item-label">Select</span></label></span></span></span></span>
    </label>

    Thank you @takayukister for guiding me in the right direction. 😉

    Thread Starter nate.ads

    (@nateads)

    Ok I think I see now. When I use something without the <div> or <h> tags it works as expected

    <label>This is a demo
    <img src="https://biosteel.ca/cdn/shop/products/PDP-Image-1194px_1194x.png" alt="" />
    [checkbox demo class:demo use_label_element "Option 1"]
    </label>

    But I unfortunately need to use at least <div> tags as the layout changes when on mobile. I tried with <span> tags and that works fine. Is there something I can disable to not have the <div> or <h> tags break the <label> closing?

    Thread Starter nate.ads

    (@nateads)

    Sorry, I’m a little lost use <label> instead of what?

    My markup in the dashboard looks like this

    <figure class="checks">
    <div class="heading">
    <h4>Product Label</h4>
    <span class="info">Product Info</span>
    </div>
    <div class="product"><img src="https://biosteel.ca/cdn/shop/products/PDP-Image-1194px_1194x.png?v=1679604164" alt="" /></div>
    <ul class="product-details">
    <li>Detail One/li>
    <li>Detail Two</li>
    <li>Detail Three</li>
    </ul>
    <p class="input">[checkbox hydration class:check-boxes use_label_element "Select|hydration"]</p>
    </figure>
    • This reply was modified 1 year, 4 months ago by nate.ads.
    • This reply was modified 1 year, 4 months ago by nate.ads.
Viewing 15 replies - 1 through 15 (of 39 total)