Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: Add custom $_POST data into the contact form email #1118010

    Hi,

    Thanks for you answer. Yes I have on purpose changed it to “lol” to see if I got any $_POST[‘lol’] .. But before it was like you say in your “it should be like this”, Iv changed the append to a after few times to see if it changes.

    You can have a look again, the code is has expected, but it still doesnt work, I don’t receive anything on email or $_POST ..

    Also I had a look in the file class-form-generator.php in /enfold/framework/php. And I am not sure, but it seems that to built the informations in the emails, it does this:

    foreach($this->form_elements as $key => $element)

    Where $this->form_elements, is an array of element directly recovered from the enfold build-in contact form element. And because the new field I want to create is not on it, it won’t never be taken into account..

    That why I was trying to play with the $_POST and override this $this->form_elements, but it doesnt work either..

    Thanks for your help, it is very important for me to make it work.

    Best regards

    in reply to: Add custom $_POST data into the contact form email #1117398

    Hi,

    No not at all there isn’t such a thing.. That’s strange, from which country are you trying to access?

    It’s perfectly working for me.. Can you try again?

    But Im not sure what you re looking for on the website? It is a very classic enfold form.

    Then I v add this on a custom.js file

    jQuery(window).load(function(){
    
            jQuery('.aw-contact-form #avia_31_1').on("change", function() {
                var newFirstDate = '<p class="first_form form_element form_element_fourth" id="element_avia_38_1"><input name="avia_38_1" class="avia_datepicker avia_datepicker_perso text_input is_empty" type="text" id="avia_38_1" value placeholder="Nouvelle date"></p>'
                var test = '<p class="first_form  form_element form_fullwidth" id="element_avia_39_1"><label for="avia_39_1">Subject</label> <input name="lol" class="text_input is_empty" id="avia_39_1" type="text"></p>'
                if(jQuery('.aw-contact-form #avia_31_1').is(':checked')) {
                    console.log("check");
                    jQuery(this).parent().append(test);
                } else {
                //alert('uncheck');
                }
            })
        });

    On the DOM everything looks fine, it appears well.
    But it doesn’t show in the $_POST data after sending the form..

    Thanks

    • This reply was modified 5 years, 4 months ago by nonowd.
    in reply to: Add custom $_POST data into the contact form email #1117013

    yes sure,

    Thanks

    in reply to: Add custom $_POST data into the contact form email #1116961

    Yes I did it correctly.

    Look: This is what I add in my custom.js when I click on the checkbox element. I do something like $(“element).append()
    <p class=”first_form form_element form_element_fourth” id=”element_avia_39_1″><input name=”avia_39_1″ class=”avia_datepicker avia_datepicker_perso text_input is_empty” type=”text” id=”avia_39_1″ value placeholder=”Nouvelle date”></p>’

    And it appears correctly in the DOM, inside the <form element> So when I submit the form, I should see in the $_POST data, the key “avia_39_1”.

    But neither I see this key (although I see all the other key, from avia_1_1 to avia_38_1) So it seems that the form doesnt recognize the fact that I add a new input. Neither in the sent message this added data appears..

    Thanks

    in reply to: Add custom $_POST data into the contact form email #1116645

    Iv tried as well to display all the $_POST data returned by the form, and the key “avia_39_1” doesnt appear.
    As if it were not recognized..

    in reply to: Add custom $_POST data into the contact form email #1116629

    Hi Ismael,

    Thanks for your answer, Iv tried to apply what you explained to my case but it didnt work..

    I even copy past your exemple, but same problem, nothing appear in the email.

    Do you know what could it be ?

    Thank you

    in reply to: Add custom $_POST data into the contact form email #1115971

    Hi,

    Thanks Vinay,

    Yes is no problem I receive all the datas built with the enfold options.

    And indeed Iv thought about put everything with the enfold options, hide the one I wanted to hide, and display them with jquery when a user would click on the checkbox.

    The problem is: I want some field in the form to be entirely dynamic. That means everytime a user would click on the checkbox, a new datepicker will appear and as well another checkbox, and if the user would click again on this new checkbox, a new field datepicker will appear and again a new checkbox etc.. (This I could do it easily with jQuery and have done it)

    Theoretically, a user could add an unlimited quantity of thoses fields. So I don’t know in advance how many field I have to build with the enfold options.

    But as I told you, thoses new created field don’t appear in the sent email. I just need to understand why, and how I can fix it. Perhaps with some kind of filter in which I will add my new $_POST[‘name’]..

    Thanks

Viewing 7 posts - 1 through 7 (of 7 total)