Right now works perfect but I need to keep send mail to yes just to execute the code on submit. Is there any way to disable send mail and keep executing the code above on submit and construct the url to redirect?. Also a little question about time to process. Is a bit slow since takes 3-4 second thinking before go to the url. Is there any way to better performance?* Child question and validationThe way that should work is show a dropdown with value 1, 2, 3 starting in value="0". So when choose 1 apper 1 drodown to select the age. With value 2 appers 2 dropdown and so on.If Child (bnin) is no selected (so value=0) age of chidls bed1,bed2,bed3 pass value="0" so is okIf bnin value=1 then 1st dropdown for age(bed1) must be different from 0 and any age must be selected. bnin value=2 so 2 dropdown and must be differents from "0" and any value (age) must be selected.Any idea how to do it? Any help will be very welcome"> Redirect url / dropdown visible-disable / validation - Forums

Forums

Redirect url / dropdown visible-disable / validation

epsdaniel 23 Feb, 2010
I am doing a formular to pass parameter to make a search.

From date to date.
N. rooms - N. Adults - N. childs (value 1 to 3) and age of the childs (1,2 or 3 dropdowns)
button search

* For redirect to a url with a differents parameters.

I put a php code into On submit code before send email:

<?php
$loc = JRequest::getVar('loc', '', 'post');
$tser = JRequest::getVar('tser', '', 'post');
$dtd = JRequest::getVar('dtd', '', 'post');
$dth = JRequest::getVar('dth', '', 'post');

$buni = JRequest::getVar('buni', '', 'post');
$badu = JRequest::getVar('badu', '', 'post');
$bnin = JRequest::getVar('bnin', '', 'post');
$bed1 = JRequest::getVar('bed1', '', 'post');
$bed2 = JRequest::getVar('bed2', '', 'post');
$bed3 = JRequest::getVar('bed3', '', 'post');

$MyForm->formrow->redirecturl = "http://midomain.com?tser=$tser&dtd=$dtd&dth=$dth&buni=$buni&badu=$badu&bnin=$bnin&bed1=$bed1&bed2=$bed2&bed3=$bed3";
?>

Right now works perfect but I need to keep send mail to yes just to execute the code on submit. Is there any way to disable send mail and keep executing the code above on submit and construct the url to redirect?. Also a little question about time to process. Is a bit slow since takes 3-4 second thinking before go to the url. Is there any way to better performance?

* Child question and validation
The way that should work is show a dropdown with value 1, 2, 3 starting in value="0". So when choose 1 apper 1 drodown to select the age. With value 2 appers 2 dropdown and so on.

If Child (bnin) is no selected (so value=0) age of chidls bed1,bed2,bed3 pass value="0" so is ok

If bnin value=1 then 1st dropdown for age(bed1) must be different from 0 and any age must be selected.
bnin value=2 so 2 dropdown and must be differents from "0" and any value (age) must be selected.

Any idea how to do it? Any help will be very welcome
GreyHead 23 Feb, 2010
Hi espdaniel,

The ReDirect Plugin will handle most of this for you without having 'Send Emails' on; using the OnSubmit After box would also work depending on the work flow for the form. (There is no particular problem with having 'Send Emails' set to on and no Emails setup.)

Don't know about the delay, you could use YSlow or the Joomla Debug to check the timing. I'd be surprised if the ChronoForms 'thinking time' was more than a few milliseconds.

Doing the double-drop-downs is possible with JavaSCript - there have been a couple of threads about this in the last few weeks.

Bob
epsdaniel 24 Feb, 2010
Hi Bob,

Thanks so much for you information. Really happy!!

About the redirect plugin is working brilliant. Makes the job much quicker and works perfect. Thanks!!. Right now with the plugin I do not have the little delay.

About the double drop-down with JS I have found some topics. I did find it before because I was looking for in php. I already found some examples and I did it successfully.

Thanks so much for you support.

Daniel
epsdaniel 25 Feb, 2010
Hi Bob

I have another problem and no idea how to solve it. I am working now with redirect plugin and all go well except when I submit and redirect to external web, when I go back thought the browser always show like a debug message with the array sent.

I have the general tab of the form, debub off and Redirect plugin debuggin off as well.

As seen with firebug show me a dl system-message with all the array.

Would you point me out whare can I switch off this message.

Thanks so much,

Daniel
GreyHead 25 Feb, 2010
Hi Daniel,

I left a debug mesage in there. Please open cf_redirect.php (in the chronoforms plugins folder). look for this code at line 234 and remove or comment it out.
$mainframe->enqueuemessage('$_POST: '.print_r($_POST, true));


Sorry

Bob
epsdaniel 25 Feb, 2010
Perfect!!!

Many thanks 😛
This topic is locked and no more replies can be posted.