Home › Forums › Quform WordPress › Redirecting with form data however posting data to another form
- This topic has 15 replies, 2 voices, and was last updated 9 years, 4 months ago by kesvel.
- AuthorPosts
- September 18, 2014 at 12:20 pm #12491kesvelParticipant
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
September 18, 2014 at 12:28 pm #12492kesvelParticipantExample of form data posted to redirected URL -:
September 22, 2014 at 11:17 am #12531AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
September 22, 2014 at 10:18 pm #12561kesvelParticipantThank you Ally for the information I will give it a try and let you know, much appreciated. – Marc
September 28, 2014 at 5:33 pm #12626kesvelParticipantHi 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’ });// 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
September 29, 2014 at 6:25 pm #12638AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
September 29, 2014 at 10:50 pm #12639kesvelParticipantHi 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
October 19, 2014 at 8:12 pm #12826kesvelParticipantHi 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’ });// 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);October 22, 2014 at 1:02 pm #12836AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
October 25, 2014 at 4:56 pm #12869kesvelParticipantHi 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’ });$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
October 25, 2014 at 5:11 pm #12870kesvelParticipantAlly,
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
October 27, 2014 at 3:43 pm #12874AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 2, 2014 at 9:38 pm #12921kesvelParticipantHi 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
November 3, 2014 at 5:51 pm #12926AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 3, 2014 at 5:52 pm #12927AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.