Forum Replies Created

Viewing 15 replies - 1 through 15 (of 32 total)
  • Thread Starter crafto

    (@crafto)

    Oh I see. Thanks for those additional explanations!

    I managed to do what I wanted but then when I showed it to my superior, they were like “well it’s ok even if it’s at the top, as long as there’s every informations needed” haha…

    Thank you again Erik for your help! Have a great day!

    Thread Starter crafto

    (@crafto)

    Hello Erik,

    I just tried your code right now and once again, thank you for helping me haha!

    Just one thing, is it possible to add “a function in an other one” ?
    -> Right now I put your function right above mine who’s sending the mail to the user but then, it’s writing the “Type de consultation : TelephoneD” for example at the top of the mail haha (which is totally normal).
    -> Or, instead is it possible to just copy the code in the $message ? I tried before to do an if in the $message, but I never succeeded so far haha. I was writing it like :

    “.if(your-condition){
    Type de consultation: VisioconferenceD
    }.”

    Edit : Or can i just copy those lines

    $components['body'] = ! empty( $data ) ? 'Type de consultation:' . implode( ', ', $data ) . '
      ' . $components['body'] : $components['body'];

    put those in the $message to replace my current “Type de consultation = $posted_data[‘VisioconferenceD’][0] . . .” for example ?

    • This reply was modified 4 years, 10 months ago by crafto.
    Thread Starter crafto

    (@crafto)

    Haha, no worries just take your time on your most important things, it’s ok!

    I’ll look more into the wpcf7_spam filter on my side (couldn’t really check those because i got my hands busy on something else for today)

    Thread Starter crafto

    (@crafto)

    I came across a stackoverflow’s topic today because I’m struggling to do “do this if checkbox not checked”.
    In that topic, someone said checkboxes only send their values only when they are checked and otherwise, if this applies to wordpress too, this is “normal” that I still have the “[VisioconferenceD]” for example since it’s not checked. And that even if I give him a “null” value, it’ll still display [VisioconferenceD] because it is not checked.

    Does someone know more about it ? Are those words true and therefore I’ll have to find an other way to write my inputs in the CF7’s form ?

    Edit : But then :
    -> The way i’m sending my mail to the user who fill the form (which is by using wp_mail), even if the [VisioconferenceD] isn’t checked, it’ll show nothing
    -> But for the mail to the admin, which i’m sending by using CF7’s mail tab, it’ll always show the [VisioconferenceD] when not checked

    • This reply was modified 4 years, 10 months ago by crafto.
    Thread Starter crafto

    (@crafto)

    Hello @codekraft, sorry for the late answer I wasn’t working those last 3 days haha.

    I tried to unset those but it’s still writing me [VisioconferenceD] for example.
    Just thought about it right now, would it work if I just give them a blank value if they are not checked like :

    if($posted_data['your-name'] == false){
       $posted_data['your-name'][0] = "";
    }

    Something like that ? I don’t know if that is the correct way to verify if they aren’t checked haha.

    Thread Starter crafto

    (@crafto)

    Ooh I see, guess I’ll stick with my [select] haha. Thank you for your answer Jules!

    Thread Starter crafto

    (@crafto)

    How can I delete this topic here since I have now asked my question on the support forum of “Conditional Fields” ? Or only admins can delete topics ?

    Thread Starter crafto

    (@crafto)

    This might be a good idea haha, thanks Erik!

    Thread Starter crafto

    (@crafto)

    Thank you for your help Eric! I’ll look more into that select2 first and if I really can’t make it work after hours trying to understand the thing, I’ll help myself with your code below haha.

    Thread Starter crafto

    (@crafto)

    Noted, I’ll be more careful next time thank you @jdembowski !

    Thread Starter crafto

    (@crafto)

    – I never heard about select2 and it looks very interesting 🤔 If I want to include it on my wordpress site, do I just copy paste the link and script on select2’s website in function.php or ?

    – As for that jedi powers, that’s what I did for the checkboxes on my form (which took me quite a moment to do and it’s still not finish cause depending on the screen size, my “check symbol” isn’t placed at the correct emplacement ._.) and I’d prefer avoiding doing this again honestly.

    For now what I need to do is
    – give to the arrow only a background color,
    – on click, give to the whole select (except arrow) a gradient of color on the background

    Thread Starter crafto

    (@crafto)

    Alright, thank you very much again Erik for the help!

    Thread Starter crafto

    (@crafto)

    Ooh I’ll keep those in mind next time I work on a wordpress site haha

    I didn’t quite get the “THISTHISTHIS” too xD, do I have to replace it by the option’s value that I want ?

    By “write that code after the “>”, do you mean writing after the [-> write here <-] 🤔

    Thread Starter crafto

    (@crafto)

    Is Gutenberg a lot more convenient than Elementor ? 🤔

    And thank you for this code Erik, it’s working very well !

    Just wanted to ask one last thing, if I ever want to make the select have a different option selected instead of replacing the “include_blank” by the argument of your code, I have to use “selectedIndex” right ?

    Thread Starter crafto

    (@crafto)

    Ah yes, by “share screens” I was meaning to capture my screen and share it (The fact of translating in my head from French to English directly can mislead a lot haha).

    As for the link you shared, it is close to what I need to do but not totally. If I understood correctly how it works, the approach to my situation should be the same. If I had to compare the link’s information to my situation :
    -> The “default:get” should be used on those h2 of “Page 2” (btw those h2 are written by using Elementor, saying it just for information)
    -> And then I need to “GET” the h2’s value to then put it in my form’s dropdown in “Page 1” as the first option

    Originally, if you go to the form with the normal link, the dropdown is the one I wrote in my CF7’s code. Therefore, if I want the dropdown to have the value of one of the h2 I have on “Page 2”, this function has to also work “onclick” of the h2.
    And therefore, I’m confused on how to do it haha.. 😭

    Do you think using Ajax can help me to do it ? (That’s where my research led me to for now)

Viewing 15 replies - 1 through 15 (of 32 total)