Redirecting with form data however posting data to another form

Home Forums Quform WordPress Redirecting with form data however posting data to another form

This topic is: resolved
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #12491
    kesvel
    Participant

    Support,

    I am currently using the following code using the integration steps in the link below. The form data is captured correctly and posts the data within $URL as shown in the example below. My aim is to instead of having the data posting with URL can I configure the script so that it is posting the data to the form at the URL.

    Test form hosted at: http://www.latestdatingsites.com/test-form

    Sample code:

    function my_form_redirect($url, $form)
    {
    $data = array(

    ‘gender’ => $form->getValue(‘iphorm_1_5′),
    ’email’ => $form->getValue(‘iphorm_1_1’),
    ‘firstname’ => $form->getValue(‘iphorm_1_2’),
    ‘lastname’ => $form->getValue(‘iphorm_1_6’),
    ‘password’ => $form->getValue(‘iphorm_1_3’),

    );

    $data = array_map(‘rawurlencode’, $data);

    $url = add_query_arg($data, ‘http://app.maturesingles365.com/signup.cfm’);
    return $url;
    }
    add_action(‘iphorm_success_redirect_url_1’, ‘my_form_redirect’, 10, 2);

    Thanks

    Kesvel

    QUFORM Resource used: https://support.themecatcher.net/quform-wordpress/guides/advanced/redirecting-with-form-data

    #12492
    kesvel
    Participant
    #12531
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #12561
    kesvel
    Participant

    Thank you Ally for the information I will give it a try and let you know, much appreciated. – Marc

    #12626
    kesvel
    Participant

    Hi Ally /TC Support,

    As suggested I am using this script to have the user redirected with the POST request, the form data posting appears to be working as the user form data is being written to the database as configured and the form is not generating errors however the user isnt being redirected so I cannot see the data being sent to the redirected form url (post action url). Please can you help me, many thanks.

    Test form is at : http://www.latestdatingsites.com/test-form

    function my_custom_success_message($message, $form)
    {
    ob_start(); ?>
    <script>
    (function ($) {
    var form = $(‘<form>’, { method: ‘POST’, action: ‘http://app.maturesingles365.com/signup.cfm&#8217; });

    // Add a line for each piece of data to send
    form.append($(‘<input>’, { type: ‘hidden’, name: ‘gender’, value: ‘<?php echo esc_js($form->getValue(‘iphorm_1_5′)); ?>’ }));
    form.append($(‘<input>’, { type: ‘hidden’, name: ’email’, value: ‘<?php echo esc_js($form->getValue(‘iphorm_1_1′)); ?>’ }));

    form.appendTo(document.body).submit();

    })(jQuery);
    </script>
    <?php
    return $message . ob_get_clean();

    }
    add_filter(‘iphorm_success_message_1’, ‘my_custom_success_message’, 10, 2);

    Thank you

    Marc

    #12638
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #12639
    kesvel
    Participant

    Hi Ally,

    Its worked, thank you so much for all your guidance and support. It is really appreciated. This post can be closed.

    Thanks again

    Regards

    Marc

    #12826
    kesvel
    Participant

    Hi Support,

    Sorry need your help again,

    Issue 1 :

    I am using the following code which takes the QUFORM form input and redirects to another script/form on another website, the input fields for email and name work fine as they are input text fields however the “gender” field is a drop down input field and the dobdate is the same.

    The form that this data is redirected to is also of the same input type however when the data is redirected it does not populate these fields. Appears the data is being redirected however not triggering with the appropriate input values.

    Issue 2:

    How do I seperate the input data of the dobdate field into 3 values to be redirected day , month , year. This maybe a solution to one of the issues above. Right the whole field is submitted as ‘iphorm_1_3’ as per the script below.

    Any help will be greatly appreciated, I am also there with the form submission. Thanks in advance

    – Marc

    function my_custom_success_message($message, $form)
    {
    ob_start(); ?>
    <script>
    (function ($) {
    var form = $(‘<form>’, { method: ‘POST’, action: ‘http://app.maturesingles365.com/signup.cfm&#8217; });

    // Add a line for each piece of data to send
    form.append($(‘<input>’, { type: ‘hidden’, name: ‘gender’, value: ‘<?php echo esc_js($form->getValue(‘iphorm_1_9′)); ?>’ }));
    form.append($(‘<input>’, { type: ‘hidden’, name: ‘firstname’, value: ‘<?php echo esc_js($form->getValue(‘iphorm_1_2′)); ?>’ }));
    form.append($(‘<input>’, { type: ‘hidden’, name: ‘dobdate’, value: ‘<?php echo esc_js($form->getValue(‘iphorm_1_3′)); ?>’ }));
    form.append($(‘<input>’, { type: ‘hidden’, name: ’email’, value: ‘<?php echo esc_js($form->getValue(‘iphorm_1_4′)); ?>’ }));
    form.append($(‘<input>’, { type: ‘hidden’, name: ‘password’, value: ‘<?php echo esc_js($form->getValue(‘iphorm_1_5′)); ?>’ }));

    form.appendTo(document.body).submit();

    })(jQuery);
    </script>
    <?php
    return $message . ob_get_clean();

    }
    add_filter(‘iphorm_success_message_1’, ‘my_custom_success_message’, 10, 2);

    #12836
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #12869
    kesvel
    Participant

    Hi Ally

    Thank you for your help,

    The issue with the drop-down for the gender worked fine, thank you.

    However after following instructions for the date, the form appears to be processing but does not redirect anymore.

    Using the following code:

    function my_custom_success_message($message, $form)
    {
    ob_start(); ?>
    <script>
    (function ($) {
    var form = $(‘<form>’, { method: ‘POST’, action: ‘http://app.maturesingles365.com/signup.cfm&#8217; });

    $date = $form->getValue(‘iphorm_1_3’);

    // Add a line for each piece of data to send
    form.append($(‘<input>’, { type: ‘hidden’, name: ‘gender’, value: ‘<?php echo esc_js($form->getValue(‘iphorm_1_10′)); ?>’ }));
    form.append($(‘<input>’, { type: ‘hidden’, name: ‘firstname’, value: ‘<?php echo esc_js($form->getValue(‘iphorm_1_2′)); ?>’ }));
    form.append($(‘<input>’, { type: ‘hidden’, name: ’email’, value: ‘<?php echo esc_js($form->getValue(‘iphorm_1_4′)); ?>’ }));
    form.append($(‘<input>’, { type: ‘hidden’, name: ‘password’, value: ‘<?php echo esc_js($form->getValue(‘iphorm_1_5′)); ?>’ }));

    form.append($(‘<input>’, { type: ‘hidden’, name: ‘dobday’, value: ‘<?php echo esc_js($date[‘day’]); ?>’ }));
    form.append($(‘<input>’, { type: ‘hidden’, name: ‘dobmonth’, value: ‘<?php echo esc_js($date[‘month’]); ?>’ }));
    form.append($(‘<input>’, { type: ‘hidden’, name: ‘dobyear’, value: ‘<?php echo esc_js($date[‘year’]); ?>’ }));

    form.appendTo(document.body).submit();

    })(jQuery);
    </script>
    <?php
    return $message . ob_get_clean();

    }
    add_filter(‘iphorm_success_message_1’, ‘my_custom_success_message’, 10, 2);

    Thanks in advance

    Marc

    #12870
    kesvel
    Participant

    Ally,

    I have the form set to send emails and the date is appearing in the form email so the form is being processed however the redirect to the other site is not happening.

    Hope it helps

    Marc

    #12874
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #12921
    kesvel
    Participant

    Hi Ally,

    Sorry had to disable the plugin for a short period as it was causing a conflict with OptimizePress with displaying the live editor not sure if you are aware of this.

    I have activated QUFORM now and the test page is live, please confirm when you have a moment as to what the issue maybe regarding the redirection.

    http://www.latestdatingsites.com/test-form/

    Thanks in advance

    Marc

    #12926
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #12927
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy