I've been working out how the multi-page plugin works and though it would be useful to make some notes of what I have found.
To create a multi-page or multi-step form you need to create one ChronoForms for each step - these are the 'child' forms. Then you need to create one more 'mother' form that will control the process. The Mother form has no Form HTML.
In the ChronoForms Forms Manager check the box by the Mother Form and click the multi-page plugin link in the left hand column. Add the number of child forms and their names in a comma separated list with no spaces. Save the Plugin Configuration.
Go to the link for the Mother Form and you will see the Step 1 child form displayed, when you submit this, the Step 2 child form is displayed and so on.
The Onsubmit Code, Emails and AutoGenerated Code (save to the database) for the Mother form will be run on the final step **only**. If the process is interrupted before this nothing will happen.
If you need intermediate processing then the OnSubmitCode, Emails and AutoGenerated Code for each Child form will be run when it is submitted.
Notes:
1) For the last step the code for the last child form will be run before the code for the Mother form.
2) The OnSubmit Before code for a child form will only be run if emaisl are enabled for that form.
You can access the data from previous steps from the session using
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
?>
This will load the data into the $posted array including all previous data and the step number.To save data you will need to create a database table that includes columns for all of the fields on all of the steps. You need to do this by hand, ChronoForms will not automate it. If one child has more fields than the others you can use this as the basis - select the check-box by the form in the Forms Manager, click the Create Table icon and use the Add Another Field button to add the remaining fields.
Enable the DB Connection in the mother form only.
If you want to save data on intermediate steps this is possible. If you enable the DB Conenction on the same table in the Child steps then the data will be saved but each save will be in a separate record. To keep the saves in the same record you need to pass the record id to the next step. Assuming you use the ChronoForms cf-id add this code to the Form HTML in the child form for Step 2
<?php
$MyForm =& CFChronoForm::getInstance();
$data = $MyForm->tablerow['jos_chronoforms_test_form_8'];
?>
<input type='hidden' name='cf_id' value='<?php echo $data->cf_id; ?>' />
This will add the value of the new record into a hidden field.You can repeat this in the remaining steps (or use the value from $posted if you are using that in your form html).
Notes:
1) For the last step you only need the DB Connection for either the last child, or the mother form as they will both save the same data.
2) You don't need the cf_id code for the first child as no data has been saved when that form is displayed.
3) If you have a multi-step form that is to be completed over a longer period, then you could re-load the form data so far from the database table if the session data is no longer available.
Bob
Multi page Form is a super feature. However, it is, a bit confused for anyone to follow. I will try to make a step by step.
1. Make each form for each step/page. It mean that If your form have 4 step, you will need to create 4 seperate form. They are call "child form". Each child form need to have submit button so It could go to next step. They also need to be puplished
2. NO DB STORE AND DB SELECTION for child form. If you by mistake select the table in DB Connection tab. You will need to use phpmyadmin, to to #__chrono_contact,select the form table to delete the table name after tablenames=jos_chronoforms_test or the data will still be stored after each step, that s not what we want!
3. Create a new form, select it and choose Multi page plugin in the left. This form, will be call mother form.
4. In multi page plugin, enter step number and insert form name step by step, eg: form1,form2,form3. Number of form name here equal to Step number.
5. Maximum number of form name in plugin IS: 50 character. So if you have more child form, use phpmyadmin, go to #__chrono_contact_plugins,select our plugin table and enter more form name in formsnames= . Then re-do step 4 and hit save, so Chrono Contact regenerate hidden code for mother form. EDIT DATABASE ONLY DO NOTHING!
6. Now only use mother form and we get step by step.
7. OptionaL: If we use upload component, child form need to be configure to accept Upload (read the tutorial). In mother form, we need to copy upload setting from child form, eg: file_1:zip|rar{2048-},file_2:zip|rar{2048-},file_3:zip|rar{2048-}, hit save so DB will be updated for upload field, or we will get empty result.
That s all for multi-page to save your data in one table🙂
5) In the older version of multi-page you can edit the field length on line 39 of cf_multi_page.php
In the newer version that I am using the maxlength is set to 150 by default ( I don't think this has been released yet - most of the changes are in the admin layout).
2) It should be sufficient to set DB Connection to 'No' to stop the child saving data.
7) I can't repeat your problems with file uploads, putting the code in the child only seems to work OK.
Bob
The multi page plugin is a great plugin, but I need a little help here.
I'm running a association and I need chronoforms for registration for an event. The thing is that the price for this event is different wether you are a member or not. Here's the form below :
name (etc...)
member ? yes / no (radio button)
#people : 1 / 2 / 3 / 4 / 5 (dropdown list)
The price for members is 50€ and for non-members :70 €.
So on next step, i'd like something like...
Thanks Mr (name), As you are (or not) a member and you registred (#people), the total price for you is (people x price).
I hope I made myself clear...
Thanks in advance...
It's probably more user-friendly to do the calculations with JavaScript on the main form page and show people the result straight away.
If you want to use a multi-page form then my first post here tells you how to get the information from earlier steps and use it in the form html.
Bob
Any suggestions, please?
I'm probably suffering from terminal stupidity, but I can't get the Multi Page plugin to work. I've created 2 forms, both of which preview independently. Then an empty mother form, with the names of my two forms in the comma separated list and the number of stages set to 2. When I preview the mother form it shows an empty page, apart from the "Powered By ChronoForms - ChronoEngine.com" footer.
Any suggestions, please?
In the Mother Form, you have to edit, go to Plugins, and check the Multi Page checkbox. That should do it.
Enable the DB Connection in the mother form only.[/quote]
How do you include these columns by hand? I have three forms and want to put them all on one database. Thanks a bunch.
I am just trying to send off an email at the end of the process. How do I do that?
Do I need to use the code somehow?
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
?>
I would just like the email to appear like:
Question One: Answer One // this is on form one
Queston Two: Answer Two //this is on form one
Question Three: Answer Three // this is on form two
Question Four: Answer Four // this is on form three etc etc....
I'm probably suffering from terminal stupidity, but I can't get the Multi Page plugin to work. I've created 2 forms, both of which preview independently. Then an empty mother form, with the names of my two forms in the comma separated list and the number of stages set to 2. When I preview the mother form it shows an empty page, apart from the "Powered By ChronoForms - ChronoEngine.com" footer.
Any suggestions, please?
In the Mother Form, you have to edit, go to Plugins, and check the Multi Page checkbox. That should do it.
Brilliant! I would never have worked that out, thank you.
@chumby, add an email to the mother form and it will be sent at the end, you need to edit the email template to include fields names from all child forms, child forms fields names need to be different of course or they will get overwritten!
Regards
Max
I am startin of trying a very simple email ... just tosee if I can get a message through at the the end (simple text only).
It is not coming through though at all... this is even before I put the form fields in.
Not sure what is going on...
Cheers
Chumby
Really need to get this sorted...
I am trying to go through the click through process and send an email (to see if it works). Once I can get that working then I will send through the variables from each child form.
So I have added an email into the mother form and just addeded some simple text. I have turned debug on.
Clicking though it all seems to be ok ... but no email comes out at the end. The debug code after the final submit is below. Can you see what is going on? I am presuming I dont need to add anything db as all I want to do is send off an email.
Thanks
Chumby
1.Form passed first SPAM check OK
2.Form passed the submissions limit (if enabled) OK
3.Form passed the Image verification (if enabled) OK
4.Form passed the server side validation (if enabled) OK
5.$_POST Array: Array ( [rego] => asasa [submit] => Next Question [cfformstep] => 7 [cf6de8173018d6ef6773a747c45efcaa] => 1 [1cf1] => 98dc480bb525ef2d52d3ab3061aa2f1b [chronoformname] => Customer_Satisfaction_Survey_Master )
6.$_FILES Array: Array ( )
7.Form passed the plugins step (if enabled) OK
8.Debug End
Thanks. When is the next update coming out? I don't really know how to mess with phpMyAdmin really at all.
@ddoughty, the new release is ready and will be available in the downloads today!
Regards,
Max
If you mean the "Email the results" drop down, I have that selected to "Yes".
I cant see any other email options in the general tab.
Ideas?
Thanks
Chumby
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /home/content/d/d/o/ddoughty/html/components/com_chronocontact/chronocontact.php(52) : eval()'d code on line 9
Fatal error: Call to a member function bind() on a non-object in /home/content/d/d/o/ddoughty/html/components/com_chronocontact/libraries/customcode.php(69) : eval()'d code on line 13
That is shown without the template, just those words.
I also get
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /home/content/d/d/o/ddoughty/html/components/com_chronocontact/chronocontact.php(52) : eval()'d code on line 9
on the top of each form.
It can be viewed at http://findawebsitedesigner.info/index.php?option=com_chronocontact&Itemid=2&chronoformname=Mother
Thanks for the help!!
Will keep working on it... thanks Max
cheers
Chumby
Please help me.
You can access the data from previous steps from the session using
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
?>
This will load the data into the $posted array including all previous data and the step number.Only a question (simple):
How to access to specific fields of the $posted array?
It seems that I'm doing something worng.
I create a mother (empty) and two child forms. I set plugin in mother.
Form1 HTML
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 125px;">Email:</label>
<input class="cf_inputbox required validate-email" maxlength="150" size="25" title="Requerido" id="text_3" name="e-mail" type="text" value="" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value=" Aceptar " name="button_43" type="submit" />
</div>
<div class="cfclear"> </div>
</div>
Form2 HTML
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
?>
Result: <?php echo $posted['e-mail']; ?>
I run mother and it opens Form1. I write something for e-mail field and submit. Form2 open but return only "Result:".
Help, please.
Field-names with hyphens/dashes cause problems please re-name the field from 'e-mail' to 'email'
Then in form 2 add
echo '<div>$posted: '.print_r($posted, true).'</div>';
after the $posted =. . . line to show everything that is in the $posted array.Bob
Then in form 2 add
echo '<div>$posted: '.print_r($posted, true).'</div>';
after the $posted =. . . line to show everything that is in the $posted array.Ok. But form2 prints only '$posted: Array ( )'
Is the array empty?
Form names like Form_0 (mother), Form_1 and Form_2 could cause problems?
1st step.
$params: JParameter Object ( [_raw] => stepscount=2 formsnames=form1,form2 debugging=1 onsubmit=before_email [_xml] => [_elements] => Array ( ) [_elementPath] => Array ( [0] => .../libraries/joomla/html/parameter/element ) [_defaultNameSpace] => _default [_registry] => Array ( [_default] => Array ( [data] => stdClass Object ( [stepscount] => 2 [formsnames] => form1,form2 [debugging] => 1 [onsubmit] => before_email ) ) ) [_errors] => Array ( ) )
formname: formtest
Pages: Array ( [0] => form1 [1] => form2 )
Current step: 1
Session data: Array ( )
2nd step.
Posted: Array ( [test] => testing@myserver.com [button_43] => Aceptar [3a2cdf770f62fb01aa5ca2a93e832410] => 1 [1cf1] => 479eb3feb21961b9b628598769e43c38 [chronoformname] => formtest )
Files: Array ( )
Current step: 1
Why "step 1" yet?
It seems that form1 is not stored in session.
If echo '<div>posted: '.print_r($session, true).'</div>'
posted: JSession Object ( [_state] => active [_expire] => 1200 [_store] => JSessionStorageDatabase Object ( [_data] => [_errors] => Array ( ) ) [_security] => Array ( [0] => fix_browser ) [_force_ssl] => [_errors] => Array ( ) )
Any idea will be appreciated.
I am using the below code to add the value of new record into a hidden field starting from step 2. But when i use this form (by clicking on mother form url) it wont go to step 2 and displays the link Powered By ChronoForms - ChronoEngine.com.
<?php
$MyForm =& CFChronoForm::getInstance();
$data = $MyForm->tablerow['jos_chronoforms_test_form_8'];
?>
<input type='hidden' name='cf_id' value='<?php echo $data->cf_id; ?>' />
On the other hand "mother form" works fine without using the above code. I have not added any other code. Mother form(no html code) has a DB connection to a table having columns corresponding to field names in form(child form).
I am using joomla 1.5x ; ChronoForms_V3.1_RC5.3.
I will really appreciate if anyone can help me in solving this problem.
Reaves
It seems that form1 is not stored in session.
MMMnnn... I think my question is solved.
It seems that form data are not stored in session until last step. Then $_POST['test'] works from form2 HTML.
I will continue testing.
My progress:
Ok, just I can access data of form1 in form2.
I can get values from an external table.
BUT, how insert these values in form2 fields?
When I insert value="xxx" (constant or $value) in HTML text fields they show empty!
And one email form2 field with no value but name like form1 shows this value (other pair fields -same name- are empty, only the email field).
I'm very confused.
Please help.
[list]1 mother form, blank, no code[/list]
[list]5 child forms with general form content, 1 submit button on each[/list]
[list]Final child form has a button named postcomments[/list]
I did the following:
[list]Selected the mother form, selected the Multi Form plugin, configured as described by you, entered child form names etc[/list]
[list]In code view of mother form, selected Plugins, enabled Multi Page, 5 steps[/list]
[list]Used my 1st step form to create the database table, edited the table with PHPMyAdmin, adding extra fields required[/list]
[list]Connected the mother form ONLY to the database table previously created[/list]
I've run this setup a number of times with DEBUG turned on, output below from pressing the postcomments button:
Posted: Array ( [greeting1] => RAIN [greeting2] => Chris [greeting3] => 08/Jul/2009 [greeting4] => 20 [greeting5] => Good [greeting6] => Good [greeting7] => Good [button_8] => Next >> [9f6c1e625743044d75b898e5ed9da4c4] => 1 [1cf1] => e39032f9577a3877f8edf43554003bcc [chronoformname] => cust_comments_0 [server1] => Good [server2] => Good [server3] => Good [button_4] => Next >> [cfformstep] => 4 [food1] => Good [food2] => Good [food3] => Truly Superior [food4] => Good [food5] => Good [button_6] => Next >> [overall1] => Good [overall2] => Good [overall3] => Truly Superior [overall4] => Good [overall5] => Good [overall6] => Better [overall7] => Food [overall8] => Food [overall9] => Testing for RAIN [postcomments] => Post Comments )
It appears that my Array contains all the data that has been input via the various forms, however, when the postcomments button is pressed no data is saved to the database. DEBUG also reports Files:Array() and Current Step:5, anything you can think of for me to try?
The problem is wizard. Fields in wizard form seems blocked.
The Wizard Edit uses a saved version of the form HTML - it will not pick up any changes made directly to the Form HTML and they will be lost. I tend not to use Wizard Edit except to set up forms in the first place. After that I'll copy and paste chunks in the Form HTML. If I need an extra input then I can use the wizard to create a 'new form' with the input and paste the code over.
@Peet, Looks like the space is causing the problem but I can't work out the cause. Is the form on-line, or can you post the drop-down html?
Bob
i have read through the forum but could not figure out a way to access the data from previous steps from the session. 😲
Followed all the steps present in your first post. I am pasting the code here .
form1
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Your Name</label>
<input class="cf_inputbox" maxlength="150" size="30" title="" id="text_0" name="text_0" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="button_0" type="submit" />
</div>
<div class="cfclear"> </div>
</div>
form2
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">your email</label>
<input class="cf_inputbox validate-email" maxlength="150" size="30" title="" id="text_0" name="text_1" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="button_1" type="submit" />
</div>
<div class="cfclear"> </div>
</div>
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
echo '<div>$posted: '.print_r($posted, true).'</div>';
?>
motherform
<?php
echo '<div>$posted: '.print_r($posted, true).'</div>';
?>
Mother form id linked to database. Can you give some suggestion?
Everything has worked great so far, but I cant get my head around this multi page thing. When I test it, I can get through each step just fine, but I dont receive the email confirmation.
I have checked the settings for Email in the mother form and have enabled email set to yes and all the necessary email fields enabled, but no email...
Any help would be greatly appreciated as I am a graphic designer (not a coder) haha
here are the debug readouts... thank you in advance
Form1
1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array ( [first_name] => test [last_name] => test [company_name] => test [phone] => test [email] => [email]ginx@gmail.com[/email] [billing_name] => test[address] => test [city] => test [state] => test [zip] => 812-003 [notes] => test [select_16] => No [button_19] => Submit [bb0326ef4598f7e9040d43daafc67892] => 1 [1cf1] => da4a9b78e9fedf453b5409c229c74c9b [chronoformname] => motherform )
6. $_FILES Array: Array ( )
7. Form passed the plugins step (if enabled) OK
Form 2
1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array ( [name] => test [address] => test [city] => test [state] => test [country] => test [notes] => test [button_15] => Submit [cfformstep] => [bb0326ef4598f7e9040d43daafc67892] => 1 [1cf1] => da4a9b78e9fedf453b5409c229c74c9b [chronoformname] => motherform )
6. $_FILES Array: Array ( )
7. Form passed the plugins step (if enabled) OK
Form 3
1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array ( [package] => test [upgrades] => [exist_domain] => [request_domain] => [notes] => test [gd_services] => test [date_19] => 23/07/2009 [print] => Yes [url_data] => [button_32] => Submit [cfformstep] => [bb0326ef4598f7e9040d43daafc67892] => 1 [1cf1] => da4a9b78e9fedf453b5409c229c74c9b [chronoformname] => motherform )
6. $_FILES Array: Array ( [file_uploaded] => Array ( [name] => ra.jpg [type] => image/jpeg [tmp_name] => /tmp/phpvWkQl8 [error] => 0 [size] => 15038 ) )
7. Form passed the plugins step (if enabled) OK
8. Debug End
9.
Redirect link set, click to test:
My guess is that you haven't enabled the emails in the Email setup. Do you have enabled=1 in the emails column of the form that's supposed to be sending them?
Bob
Sorry to have wasted your time with that but thank you for pointing that out or I would have sat here all night with a dumb look on my face.
ChronoEngine really is the best I have dealt with related to any product support, thank you really!
No problem at all, it's usually much easier to spot these when you haven't spent hours staring at the screen scratching your head first.
Bob
This code is to get information from previous steps correct?
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
?>
Am I correct in entering that in the MotherForm >> Form Codes >> Form HTML area??
Thanks again for helping a non-coder
edit:
I tried enabling all email settings for each child and i receive the email confirms in 3 different mails, not ideal but better than not getting them...
The Previous values code goes into the Form HTML for the next step (or possibly the OnSubmit code box or the Email template depending on what you want to do with it).
Bob
Thanks for all your help, its 2:00am here in Japan so I appreciate your helpin me get to bed before the sun came up haha
Ryan (in Fukuoka, Japan - ChronoForms is truly international isnt it haha)
The HTML from my other post, truncated return variable due to the space between words is as follows:
<?php
$db =& JFactory::getDBO();
$query = "SELECT `empl_fullname` FROM `rai_chronoforms_empl_details`";
$db->setQuery($query, 0);
$item=$db->loadResultArray();
$t_rows=count($item,0);
foreach($item as $t_row){
print "<option value=".$t_row.">".$t_row."</option>";
}
?>
When the form is posted for a John Smith, the drop down box contains John Smith, the option value=".$t_row." saves only John in the database.. Nother question sorry... I've got the validation working fine on this site, just created a new form on another site, validation doesn't work. This other site has the MOOTOOLS library being loaded from Google, would this library be a problem for ChronoForms? I've tried going back to the Joomla version of MOOTOOLS but still no joy...
I just checked back - it does say
Enable the DB Connection in the mother form only.
way back in the first post here :-(The John problem is because the html is misquoted (this is one of the trickiest things to get right!) You have
print "<option value=".$t_row.">".$t_row."</option>";
If you look at the Form HTML for the John Smith line you will see something likeprint "<option value=John Smith>John Smith</option>";
Note that there are no quotes round the value so the browser makes a best guess at what you intended - in this case value=JohnBetter code would be
print "<option value='".$t_row."'>".$t_row."</option>";
but actually, you don't need to add ". ." around simple variable names* so you could useprint "<option value='$t_row'>$t_row</option>";
which is easier to read and less prone to quoting errors.Lastly, Joomla and ChronoForms use the MooTools 1.11 library (not the current 1.2 releases) provided that you are picking that version up from Google it should work OK.
Bob
* Array names like $array['key'], and object names like $object->element must be wrapped in ". ." or '. .' though
<div id="CF_LV_ERROR_text_1" style="display:none">
<div class="cfclear"> </div>
<span class="cf_alert">
<ol>
<li>Please enter a full name for this employee</li>
<li>Only alphabetical characters are allowed</li>
</ol>
</span>
</div>
My final page posts data collected to one database table, is it possible to post data from another of the forms to a different table? Once again thanks for all the help with this
I'm sure that you can save some data to another table. The question is how best to do it. You can experiment with turning on the DB Connection in the sub-form but I'm not certain that will work correctly. It' sprobably better to 'borrow' the code from an AutoGenerated Code Tab and re-use it in an OnSubmit Tab with appropriate edits.
Basically the bind + store that Joomla uses and Max has used in ChrnoForms binds a results array (typically $post) with the array of column names from a database table. The binding works for fields names that match column names. Teh store step them saves the data to the table, if the Primary Key field value already exists in the table then the record will be updated, otherwise a new record will be created.
Any fields/columns that don't match will be ignored in this process (columns will be given their default values if they are set).
Bob
I followed this post and it seams that I'm missing something.
I'm working on a multi page form and I want to display data of the first one on the second one.
this is what I did so far:
Create the form1
create the form2
create the mother form
when I open mother form I see form1 I compleate form1 and submit then I see form2
this is working OK for now
now I what to show data of form1 on form2
I added this code to the top of form2 html code:
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
echo '<div>$posted: '.print_r($posted, true).'</div>';
?>
total: <?php echo $posted['grandtotal']; ?>
the only thing I see is
$posted: Array ( )
total:
and below the form2
my debug code shows at top of form2 like this
Posted: Array ( [email] => [objectcat] => 1 [objectsubcat1] => 3800.00 [objectsubcat2] => 0 [objectsubcat3] => 0 [objectsubcat4] => 0 [objectsubcat5] => 0 [objectsubcat6] => 0 [objectsubcat7] => 0 [objectsubcat8] => 0 [objectsubcat9] => 0 [total33] => 3800 [secondp] => a1 [weeks21] => 3600.00 [weeks22] => 0 [weeks23] => 0 [weeks24] => 0 [weeks25] => 0 [weeks26] => 0 [weeks27] => 0 [weeks28] => 0 [weeks29] => 0 [total2] => 3600 [optprogsel] => 0 [optprogsel2] => 0 [colladmpr] => [totalopt] => 0 [date_0] => [date_1] => [resultDate] => [acommodationty] => [valuaccom] => 0 [grandtotal] => 7400 [next1] => Submit [0d34171c948ee610e706e82edc302674] => 1 [1cf1] => 6684e0775703352a6c46e67a8f345bdc [chronoformname] => mother )
Files: Array ( )
Current step: 1
should I add something on mother form or form1?
mother form is empty no html and no other optios are set up there.
I read this post a lot of times and I'm messing something for sure.
Any help will be appreciated
thanks cesar
This looks OK to me,and it ought to work.
Try adding this extra debug line - caution, it may give you a lot of output.
<?php
$session =& JFactory::getSession();
echo '<div>$session: '.print_r($session, true).'</div>'; // add this line
. . .
Bob
Thanks for your reply
I added the code on form2 like this:
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
echo '<div>$posted: '.print_r($posted, true).'</div>';
echo '<div>$session: '.print_r($session, true).'</div>'; // add this line
?>
total: <?php echo $posted['grandtotal']; ?>
and this is the result
$posted: Array ( )
$session: JSession Object ( [_state] => active [_expire] => 900 [_store] => JSessionStorageDatabase Object ( [_data] => [_errors] => Array ( ) ) [_security] => Array ( [0] => fix_browser ) [_force_ssl] => [_errors] => Array ( ) )
total:
I think this is not what is expected
just a question to be sure. Nothing has to be put on form1 and nothing as to be put on mother form?
The value of the submit button on form1 had to be 'submit'? or have nothing to do with it?
any idea?
I enable debug in mother form an this is the result
1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array ( [objectcat] => 1 [objectsubcat1] => 450.00 [objectsubcat2] => 0 [objectsubcat3] => 0 [objectsubcat4] => 0 [objectsubcat5] => 0 [objectsubcat6] => 0 [objectsubcat7] => 0 [objectsubcat8] => 0 [objectsubcat9] => 0 [total33] => 450 [secondp] => 0 [weeks21] => 0 [weeks22] => 0 [weeks23] => 0 [weeks24] => 0 [weeks25] => 0 [weeks26] => 0 [weeks27] => 0 [weeks28] => 0 [weeks29] => 0 [total2] => 0 [optprogsel] => 460.00 [optprogsel2] => 0 [colladmpr] => 0 [totalopt] => 460 [date_0] => [date_1] => [resultDate] => [acommodationty] => [valuaccom] => 0 [airportr] => [valutransfer] => 0 [visa] => [visadocs] => [valuvisadocs] => 0 [healthins] => [weeksins] => [valuhealth] => 0 [grandtotal] => 910 [submit] => Next [21ca8b15bbd2f52eb862649b8d2fc453] => 1 [1cf1] => 0f17d33db089e5f524be94db2e91a73d [chronoformname] => mother )
6. $_FILES Array: Array ( )
7. Form passed the plugins step (if enabled) OK
I'm confused now. There doesn't appear to be any session data at all which is very odd. 'Normal' Joomla session info includes at least all of the current user info.
If the form is on-line and it's OK with you please send me a SuperAdmin login and I'll take a closer look.
Bob
http://www.inlingua-fortlauderdale.com/administrator/
user: support
pass: xxxxx
let me know when you finish so I can disable it
__default|a:8:{s:15:"session.counter";i:3;s:19:"session.timer.start";i:1248711002;s:18:"session.timer.last"; i:1248711040;s:17:"session.timer.now";i:1248711080;s:22:"session.client.browser";s:124:"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.1)";s:8:"registry";O:9:"JRegistry":3:{s:17:"_defaultNameSpace";s:7:"session";s:9:"_registry";a:1:{s:7:"session";a:1:{s:4:"data";O:8:"stdClass":0:{}}}s:7:"_errors";a:0:{}}s:4:"user";O:5:"JUser":19:{s:2:"id";i:0;s:4:"name";N;s:8:"username";N;s:5:"email";N;s:8:"password";N;s:14:"password_clear";s:0:""; s:8:"usertype";N;s:5:"block";N;s:9:"sendEmail";i:0;s:3:"gid";i:0;s:12:"registerDate";N;s:13:"lastvisitDate"; N;s:10:"activation";N;s:6:"params";N;s:3:"aid";i:0;s:5:"guest";i:1;s:7:"_params";O:10:"JParameter":7:{s:4:"_raw";s:0:"";s:4:"_xml";N;s:9:"_elements";a:0:{}s:12:"_elementPath";a:1:{i:0;s:57:"/var/www/fortlaud/libraries/joomla/html/parameter/element";}s:17:"_defaultNameSpace";s:8:"_default";s:9:"_registry";a:1:{s:8:"_default";a:1:{s:4:"data";O:8:"stdClass":0:{}}}s:7:"_errors";a:0:{}}s:9:"_errorMsg";N;s:7:"_errors";a:0:{}}s:13:"session.token";s:32:"847d7ea719a0597b0b91c0a1060df5c0";}__eb81adcc4edfeccb1ba0f16dfe1a737f|a:3:{s:18:"chrono_step_mother";i:2;s:28:"chrono_formpages_data_mother";a:46:{s:9:"objectcat";s:1:"1";s:13:"objectsubcat1";s:7:"5000.00";s:13:"objectsubcat2";s:0:"";s:13:"objectsubcat3"; s:0:"";s:13:"objectsubcat4";s:0:"";s:13:"objectsubcat5";s:0:"";s:13:"objectsubcat6";s:0:"";s:13:"objectsubcat7"; s:0:"";s:13:"objectsubcat8";s:0:"";s:13:"objectsubcat9";s:0:"";s:14:"objectsubcat10";s:0:"";s:7:"total33";s:4:"5000"; s:7:"secondp";s:1:"0";s:7:"weeks21";s:1:"0";s:7:"weeks22";s:1:"0";s:7:"weeks23";s:1:"0";s:7:"weeks24";s:1:"0"; s:7:"weeks25";s:1:"0";s:7:"weeks26";s:1:"0";s:7:"weeks27";s:1:"0";s:7:"weeks28";s:1:"0";s:7:"weeks29";s:1:"0"; s:8:"weeks210";s:1:"0";s:6:"total2";s:1:"0";s:10:"optprogsel";s:1:"0";s:11:"optprogsel2";s:6:"520.00";s:9:"colladmpr"; s:1:"0";s:8:"totalopt";s:3:"520";s:6:"date_0";s:0:"";s:6:"date_1";s:0:"";s:10:"resultDate";s:0:"";s:14:"acommodationty";s:1:"0";s:9:"valuaccom";s:1:"0";s:8:"airportr";s:2:"85";s:12:"valutransfer";s:2:"85";s:4:"visa";s:1:"2";s:8:"visadocs"; s:0:"";s:12:"valuvisadocs";s:1:"0";s:9:"healthins";s:0:"";s:8:"weeksins";s:0:"";s:10:"valuhealth";s:1:"0"; s:10:"grandtotal";s:4:"5605";s:6:"submit";s:4:"Next";s:32:"054c15b55f7c7883a2e153ef9d0d1242"; s:1:"1";s:4:"1cf1";s:32:"a77694b4c10076058df0936499af9d85";s:14:"chronoformname";s:6:"mother";} s:29:"chrono_formpages_files_mother";a:0:{}}
it seams that the php code inside the form is not loading the array?
I'm not a big php coder I dont know if it helps
I tested this on a client site yesterday and the $posted route doesn't seem to work any more in the form I had it. (All the data was available in the $_POST array though.)
Looking at your session data I see "chrono_formpages_data_mother" so perhaps you need the form_name on the end. Please try
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data_mother', array(), md5('chrono'));
echo '<div>$posted: '.print_r($posted, true).'</div>';
?>
total: <?php echo $posted['grandtotal']; ?>
Bob
it works this way!
the posted array shows correctly.
What difference do you think it'll be if I don't use the head lines
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data_mother', array(), md5('chrono'));
and just use
$posted[xxxx]
?
I don't think it will work, test by commenting out the lines with // at the beginning to see what happens.
Bob
When I preview the mother form it shows an empty page, apart from the "Powered By ChronoForms - ChronoEngine.com" footer.
But I DID do what was suggested right afterwards - in the plugins page, "multi page" plugin is selected (it's got the green checkmark by it).
This is the debug message that comes up at the top of of multi1_parent:
$params: JParameter Object ( [_raw] => debugging=0 onsubmit=before_email stepscount= formsnames= stepsnavigation=0 [_xml] => [_elements] => Array ( ) [_elementPath] => Array ( [0] => /Applications/MAMP/htdocs/joomla/libraries/joomla/html/parameter/element ) [_defaultNameSpace] => _default [_registry] => Array ( [_default] => Array ( [data] => stdClass Object ( [debugging] => 1 [onsubmit] => before_email [stepscount] => 2 [formsnames] => multi1_name,multi1_email [stepsnavigation] => 1 [finalbuttonname] => Submit Both ) ) ) [_errors] => Array ( ) )
Obviously the stepscount and formsnames fields are blank - but I'm looking AT the page right now, and I've got 2 steps selected, I've got the two form names correctly in the text field... why isn't it taking??
Screenshot: http://jen-m.com/miscfiles/multiform_debug1.png
Somebody pleeeease help...🙂 If someone can help walk me through this on IM, I would greatly appreciate it!!
Can you PLEASE revert the UI to where it's a simple checkbox that CLEARLY shows whether the plugin is active or not? When you see a green checkbox, you think it's enabled, but it wasn't! (I would think that my UI is outdated but I just updated the plugin yesterday...)
I agree, that particular piece of UI design - used for Plugins and for the DB table - is particularly misleading. It was talked abotu here a week or co back.
Bob
I am trying to post a variable from page 1 of a form to page 2 of the form. I've edited the page2 form to include the session/posted array, BUT I can't seem to be able to print the variable out. It shows in debug, but it doesn't show on the form.
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
?>
<hr/>
<?
echo "<div>Name: " . $posted['name'] . "</div>";
?>
<hr/>
The result of this is shown below.

So, how can I grab the posted name from step1 in step2?
Also, I've set up the emails in the parent form, but they don't seem to be working, at all. Do I need to put any of the php code into the parent code form, for after submission or email template or anything?? Especially since I need to grab the email address from Step 2 and use it for a dynamic to - how can I make sure that's grabbed??
Thanks........
Try echoing out $posted without the $session lines - I think that it is passed on automatically
<?php
//$session =& JFactory::getSession();
//$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
echo '<div>$posted: '.print_r($posted, true).'</div>';
?>
Bob
What a brilliant little plugin!
I've completed a multipage form with paypal integration, but I cannot solve the problem of validate the fields before to shoot the paypal transaction...
is the validation to be set on the mother form or on the childs?
Thank you for you help
Luca
After some initial problems I have got the multipage plugin working. I did find it confusing at first, but after some easy answers by the right people it is actually straight forward.
I am now coming to the stage where things are due to get a little bit more complicated though, and this bit I would know where to begin, so any help and guidance would be appreciated.
I have my motherform and 4 child forms created a 4 page process. The way the form(s) currently work is that I do not use tables in the db and let the form email it out at the end.
In 3 of the child forms I have a textarea for an address, now depending on the situation of each business these may all be different, the same or 2 the same 1 different etc. But what I want to try and do is to give the user the ability to copy one of the addresses in one of the other textareas.
EG;
Text area 1 = Main address
Text area 2 = Warehouse address
Text area 3 = invoice address.
How would I place a button (or the ability) for them to copy Text area 1 into text area 2. and again on text area 3 give them the ability to copy either text area 1 or text area 2 into it? I know that if you were to use tables then there may be a way to place a button in which when clicked connects to the table and inputs the data from TA1 into TA2 etc, but if possible I would prefer to do it without the table (for now at least)
I will come back with my other question in a moment as I need to think it through first.
Regards,
Without working it though in detail I think I'd just add a radio-button on the later forms. Then you have a choice; on OnSubmit you could copy over the Textarea 1 value to Textarea 2 (or use JavaScript to do it live).
If you were saving into a table it might be better to have a separate table with user_id + address_id + address and simply save the address_id into the main table.
Bob
The address fields are mandatory and as such required. So in the first instance, the 2 radio buttons would need to have some control over the text area.
IE radio button 1 = Same as address 1, or radio button 2 = use this address.
If button 1 is used then text area 2 becomes un required and hidden, but if button 2 was chosen then text area 2 becomes visable and required.
In order for this to work live we would be talking ajax in the actual form. If however we gave the option to supply alternate addresses before we got to these forms then it would be a case of either directing them to a different form, or there being a call in the continue button which hides text area 2 and 3 etc. (Sorry if you get lost in what I mean there).
As it is, the multipage setup is very nice and does add a lot of class to any form. But (and idea custosy of me lol) what would be awesome is the ability to make the multipage form intelectual enough in the sense that depending on certain answers depends on what the next form will be.
So as an example, the Motherform (lets call it the form wrapper) holds a total of 10 subforms.
The whole process of completing a form is only 4 steps long (so can only be a total of 4 subforms after one another). But step 1 would always be the same subform if say Q3 on step 1 had 3 answers each answer would cause a different second step form to be called up.
Does this make any kind of sense? Or am I talking cryptic lol ?
I was wondering something just about 3 minutes ago. When using multipage forms, how easy would it be to (if possible) to pull the entry of a field into the name of a checkbox.
Say page 1 had a textfield and the user entered "My Name" then page 4 (sorry form 4) had a checkbox which has to be checked but I wanted the text for this to read
"I 'My Name' hereby accept the conditions of the service I am applying to and grant 123 the right to..."
Now I dont think it would be as simple as putting the text for the checkbox as I '{text_1}' hereby accept...". So do you know how I could easily achieve this result ? Basically it would need to reflect what ever was placed in that field....
Regards,
That's no problem - just use the text from the $posted array and include it in the form HTML. I don't think that you can use the {. . .} syntax but something like this should work
'I <?php echo $posted['text_1']; ?>' hereby accept...".
If you check my multi-page form here you'll see that the value of the Benefits 1 box in Step 1 is displayed in the title of Step 2.
Bob
and I was going to use something a little more complex that this (for what reason I do not know lol)
I was going to use this
<script type="text/javascript">
<!-- Hide script form old browsers
var s1authname = "";
function InitSaveVariables(form) {
s1authname = form.s1authname.value;
}
function infoCopy(form) {
if (form.copy.checked) {
InitSaveVariables(form);
form.s1authname.value = form.s4authnamecopy.value;
}
else {
form.s1authname.value = s1authname;
}
}
// End hide -->
</script>
Slightly modified from what I had found. Problem was where to place it and then to build the
<input type="checkbox" name="copy"
OnClick="javascript:infoCopy(this.form);" value="checkbox">
into the form also.I like your version though Bob for shortness and uniqueness😀 But I guess I will need to edit it in html to include the php ?
You approach would work Ok if you were making the change on the same form (or the same form step). However, the Multi-Page plugin returns to the server between each step and IMHO it's easier to add the code in PHP when the Form HTML is being written.
Any, yes you would need to add PHP to the Form HTML as ai did in my example here.
Bob
Here's the how I'd like it to work;
Time worked -> Equipment Time -> (add another if yes reload Equipment Time else move on) -> Billing ticket -> (add another if yes reload ticket form else finish)
I figured out how to do the conditional loops but I can't get chrono forms to automatically save the intermediate steps so I don't lose the first set of data if the loop is used.
Any ideas?
Sean
Please check the first few posts in this thread which talked about saving after each step.
Bob
I've read through the first few posts and it seems like version 3.1 RC5.5 doesn't save the intermediate steps. I suppose I could add custom code to insert the data into the database table. I had hoped it would be simpler then that as I have a few different versions of this form I need to implement.
I'll have to check if there's a newer version available and see if it works in that version. It would be nice if each step could save the data in a different table.
Sean
As discussed earlier, multi-page form is made up of separate forms. Just have each form's "DBConnection" set individually, and it should do exactly that - save it at that step.
Did you set yours up like that, test it, and did it not work?
Jenny
If you want to save data on intermediate steps this is possible. If you enable the DB Conenction on the same table in the Child steps then the data will be saved but each save will be in a separate record. To keep the saves in the same record you need to pass the record id to the next step. Assuming you use the ChronoForms cf-id add this code to the Form HTML in the child form for Step 2
<?php
$MyForm =& CFChronoForm::getInstance();
$data = $MyForm->tablerow['jos_chronoforms_test_form_8'];
?>
<input type='hidden' name='cf_id' value='<?php echo $data->cf_id; ?>' />
This will add the value of the new record into a hidden field.
This is what I have working, could be that Max has changed something in the latest release. Have you tested?
Bob
Thanks for the help guys.
Sean
<?php
$MyForm =& CFChronoForm::getInstance();
$data = $MyForm->tablerow['jos_chronoforms_pilot_daily'];
?>
<input type='hidden' name='cf_id' value='<?php echo $data->cf_id; ?>' />
<div class="form_item">
<div class="form_element cf_heading">
<h1 class="cf_text"><ul>Aircraft Times</ul></h1>
</div>
<div class="cfclear"> </div>
</div>
Fatal error: Class 'CFChronoForm' not found in C:\Program Files\xampplite\xampp\htdocs\joomla\administrator\components\com_chronocontact\admin.chronocontact.php(2736) : eval()'d code on line 8
Yet in the autogenerated code it calls the class with no problem. I'll have to see if I can work around it if I get time later today.
Sean
Sean
A question I forgot to ask the other day was with regards to captcha verification. I dont want it on every form, but instead just on the last page. I presume I would drag the captcha field across, but then would I enable the verification on the form for the last page or the mother form ?
Regards,
HSN
Just on the last page I think, but I'd have to check to be sure.
But how does a Captcha on the last page help? It would have to be a pretty determined bot to get there.
Bob
Forgot who it was though🙂
I have run into a bit of a snag with the old multipage setup.
I have the initial form open up in rokbox with &tmpl=component . As expected this strips out the template etc and only reveals the form. The problem was that when I clicked on the continue button to move onto the second form, it then included the template.
How could I overcome this so that each form automatically uses &tmpl=component ?
Regards,
I don't know the answer to that one - it ought to be possible with JRoute . . . but ChronoForms doesn't have a router file for JRoute to use :-(
Bob
Hi-
Captcha Verification is not working with Multi_page. Could you help troubleshoot my problem?
CONFIGURATION SPECS:
Joomla 1.5.7
Chronoforms V3.1 RC 5.0
Plugin Version V3.1 RC 5.0
childform A - No Captcha Verification
childform B - Captcha Verification on form - Captcha Verification enabled
motherform - blank form - Captcha verification disabled
Watchman is Enabled and working
Successful database attached to the motherform
Successful Emails being sent out by the motherform
PROBLEM:
Under this configuration,
Multi_page is successfully going from childform A to childform B.
Captcha Verification is not working though.
Even with leaving the captcha area blank, the form proceeds to send the emails, write to the database, and redirect to the "Entry Submitted" page.
Also, if I open childform B by itself and submit with a blank captcha, verification works and the form will not proceed to successful submission.
If I enable the Captcha Verification in the Mother form, childform A does not go to childform B, but goes from childform A to childform A.
RANDOM SPECIFICATIONS ABOUT THE CASE that may or may not be applicable:
- I tried the upgrade to Chronoforms V3.1 RC 5.5 (and plugins too). (I was previously troubleshooting database problems.) Multi_page didn't work at all. Motherform went from childform A to childform A. Used the "Upgraded php" button in this troubleshooting process but...
- Ended up uninstalling Chronoforms V3.1 RC 5.5 and reinstalling Chronoforms V3.1 RC 5.0
Other Extensions installed on Site, though not on specific page:
eXtplorer 2.0.0
userport
docman 1.4.0rc3
2j_news_slider 1.0.2
I am having trouble with the multi page plugin in two ways:
1. I can't seem to have each child form connected to the DB without getting this error quoted below (same from ddoughty's post on page 2 of this thread - but never answered). When I unconnect the child forms from the DB, the error goes away - but really I'd like it to logg in the DB at each step.
Fatal error: Call to a member function bind() on a non-object in /home/content/d/d/o/ddoughty/html/components/com_chronocontact/libraries/customcode.php(69) : eval()'d code on line 13
That is shown without the template, just those words.
2. The OnSubmit Code is not updating the $posted array. Below is my code in the On Submit box. It used to just update the field, but that wasn't working, so I changed it to updating the posted array at the field location. It works in temporarily if I say $posted[$field]=$update instead of the JRequest::SetVar, but when it get's to the next child form it's gone again (back to what $field was when the form loaded.
<?php
$s_id=JRequest::getVar('s_id', '', 'post');
$db =& JFactory::getDBO();
$query ="SELECT `s_org` FROM `#__chronoforms_S_Reg` WHERE `cf_id`=$s_id";
$db->setQuery($query);
$results = $db->loadObjectList() ;
foreach ($results as $result) {
$o_id = $result->s_org;
}
$db =& JFactory::getDBO();
$query ="SELECT * FROM `#__chronoforms_No_Lunch` WHERE `cf_user_id`=$o_id";
$db->setQuery($query);
$results = $db->loadObjectList() ;
foreach ($results as $result) {
}
for($i=1; $i<13; $i++) {
$field="check0".$i;
$checkvalue=JRequest::getVar($field, '', 'post');
$M=$checkvalue[strlen($checkvalue)-1];
$T=$checkvalue[strlen($checkvalue)-1];
$W=$checkvalue[strlen($checkvalue)-1];
$Th=$checkvalue[strlen($checkvalue)-1];
$F=$checkvalue[strlen($checkvalue)-1];
if (strlen($checkvalue)>0) {
for($j=1; $j<31; $j++) {
$datefield = "date_".$j;
$no_lunch=$result->$datefield;
if ($no_lunch[strlen($no_lunch)-1] == $checkvalue[0]) {
if ($no_lunch[0] == 1) {
--$M; }
if ($no_lunch[0] == 2) {
--$T; }
if ($no_lunch[0] == 3) {
--$W; }
if ($no_lunch[0] == 4) {
--$Th; }
if ($no_lunch[0] == 5) {
--$F; }
}
}
}
$update = $checkvalue." ".$M.$T.$W.$Th.$F;
JRequest::setVar($posted[$field],$update,'post');
}
?>
Let me know if I need to include more information!
Thank you for your help!
The Error message shows up if ChronoForm is unable to open the Table info it has saved about the DB Connection. Please check the Autogenerated code and you should find a line like this round line 4
$row =& JTable::getInstance("chronoforms_form_name", "Table");
What do you see in your child forms?I find it quite hard to follow the logic of your PHP but this line looks odd to me
JRequest::setVar($posted[$field], $update, 'post');
Does the $posted[] belong in there, should it not just be $field i.e. 'check01', 'check02' . . .I also suspect that the $field = "check0".$i; may fail if $i > 10 as it will give 'check010' instead of 'check10'
Bob
I do see that line in the autogenerated code on line 5. Should I delete it or modify it or move it to my form code?
As for the PHP, what I'm doing is going through the check boxes in the O_Form_Dates and seeing if any of the checked dates have holidays in them where I don't provide lunch. The holidays for a given organization is stored in another table _No_Lunch. You are right that $field makes more sense to setVar for, but in the next form, $posted[$field] is set to what it was originally before the onSubmit code was run, so I figured I needed to update $posted. As for the $i>10 ... it seems to work because i called my checkboxes check010, check011, and check012.
Any thoughts to get the value in $posted[$field] to update through to the next form?
Thank you!
What's in the line - and does the table name there exactly match the table in your database?
I think $posted is a temporary holding variable, try adding the value back to the $_POST array with
JRequest::setvar('var_name', $var_value);
Bob
It does seem to be correct:
$row =& JTable::getInstance("chronoforms_Order", "Table");
jos_chronoforms_Order is the table in the DB that has all the fields in the multi page plugin, and it is what the DB connection is set to in this forms DB tab.
What else can I check?
Thank you!
I looked through the auto gen code some more and saw later in the code the DB table is reffered to as jos_chronoforms_Order... should it say jos_chronoforms_Order in the line you are refering to? In another form I have it doesn't say jos_... at the top either and it works, but maybe this is different in the multip page plugin?
Thank you!
I figured out the problem. I'm not sure it makes sense though.
I have 3 steps in the form, and the last one wasn't connected to the db yet because I haven't finished the form and added the fields to the db. All other forms were connected with the correct table. So, I connected the last form to the table, and now it works.
Does that make sense? How would the first step be messed up by the last step not being connected?
Thank you for all your help Bob ... what you told me made me realize it was something to do with the forms connecting to the DB.
OK - great that you fixed it. I agree that it doesn't make sense, and I don't know why it would work that way without going to dig in the code.
Bob
Has anyone ever figured this error out using getInstance in the Multi Page plugin? This post was never answered as the person said they were going to do something different. I'm getting the same error and I need a way to get my cf_id because I am saving to the DB at each step.
I tried inserting the code as suggested and got the following error when I went to save the form:
<?php
$MyForm =& CFChronoForm::getInstance();
$data = $MyForm->tablerow['jos_chronoforms_pilot_daily'];
?>
<input type='hidden' name='cf_id' value='<?php echo $data->cf_id; ?>' />
<div class="form_item">
<div class="form_element cf_heading">
<h1 class="cf_text"><ul>Aircraft Times</ul></h1>
</div>
<div class="cfclear"> </div>
</div>
Fatal error: Class 'CFChronoForm' not found in C:\Program Files\xampplite\xampp\htdocs\joomla\administrator\components\com_chronocontact\admin.chronocontact.php(2736) : eval()'d code on line 8
Yet in the autogenerated code it calls the class with no problem. I'll have to see if I can work around it if I get time later today.
Sean
Thank you!
$cf_id=mysql_insert_id();
into the onSubmit code of the first form in the chain - make sure you are putting it in the AFTER EMAIL ONSUBMIT and set the DB to save BEFORE EMAIL so that you can get the id that it was saved to after it saves.You can access $_POST['field'] for every thing except the cf_id. Also, for anyone having trouble where onsubmit code is changing field values and $_POST is not updating ... just
JRequest::setVar('field_name', $newvalue);
and this will update the $_POST. This happened to me and it took a long time to figure out that $_POST wasn't updating in the onsubmit code.Hope this helps anyone who can't get the getInstance code to work!
<input value="" name="cf_id" type="hidden" />
You also need to update $_POST after you get the id, so this is what goes in the onSubmit AFTER email:
<?php
$cf_id=mysql_insert_id();
JRequest::setVar('cf_id',$cf_id);
?>
Then in the next forms in the chain you put
$cf_id=$_POST['cf_id'];
This forum thread has gotten fairly long and has run through many different versions of Chronoforms. I feel some of the steps in the first few posts of how to make the Multipage plugin work may no longer be applicable.
Would you be able to write up a quick updated summary of how to get this pluggin to work properly in the current version of Chronoforms, and include the snippets of code that one adds to make the multiple forms write to the databases properly?
Thank you. I know you're busy, but it would be very appreciated.🙂
I'm a beginner with multipage forms. I have 1 motherpage and child1 and child2 . Where do I have to put the OnSubmit() code. And what to fill in it? is it 'child1,'child2' ?
Please help
problem is that nothing I filled in was send in my email. Only the dnamic email and dynamic name.
Thank you!
a) Add the OnSubmit code where you want it to execute. In the child form if you want it when the step is submitted, in the mother if you want it at the end.
b) from the Help tab
List the names of the forms in the input box: form_1,form_2,. . .
Bob
The fields chil1,child2 are allready filled in. The form seems to work fine, step by step. When pushing the send button no errors returned. When opening my mail no data is returned. Only the emailadres (dynamic email field) and name (dynamic name field)
Question is what to put into the onSubmit(..?..) -code?
I've also put this code into the extra formcode in child2-form in before email where 'cursus' is a name of the field
<?php
$session =& JFactory::getSession();
$posted = $session->get('cursus','field2','field3');
?>
Is this correct?
I've made a new motherform and 2 child-forms:
form1 index.php?option=com_chronocontact&chronoformname=form1 Enabled:1
form2 index.php?option=com_chronocontact&chronoformname=form2 Enabled:1
motherform index.php?option=com_chronocontact&chronoformname=motherform Enabled:1
in Motherform filled in under the tab formcode by onsubmit after sending:
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
?>
But still get 3 forms in email.
I've tried all possible way's but can't figure it out anymore ... please help!
Perhaps you can tell us what you are trying to do here!?
You don't *need* any onSubmit code and it's most unlikely that you need the session code either.
You are probably getting three emails because you have three emails enabled, one in the mother and one in each child.
Bob
i;m trying to make a multipage form. Consist of 2 steps. Both steps have to be sent in one email. That's it
Then remove - (a) all the OnSubmit code; (b) the email setups from the child forms (you can turn Email off on the General Tab if you prefer).
Create an email template in the Mother form using the {field_name} syntax.
That should be it.
Turn on Debug on the Mother form, submit the forms and check the results.
Bob
Hmmm . . . odd, almost midnight here, I'll check in the morning.
Bob
Works OK here. I can include info from both child forms (I have two) using {field_name} in an E-mail template in the mother form.
Bob
Hi Mgringo,
Works OK here. I can include info from both child forms (I have two) using {field_name} in an E-mail template in the mother form.
Bob
hmm strange, and email of both child forms are disabled? I've tried all possible situations... sending form from the last child, sending from motherform. Could it be depending on what server the site is hosted???
Mgringo
Yes; there are no email Setups in either child, just in the mother.
Bob
I give you my form codes:
child1
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Click Me to Edit</label>
<input class="cf_inputbox" maxlength="150" size="30" title="" id="text_0" name="text_0" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="button_1" type="submit" />
</div>
<div class="cfclear"> </div>
</div>
cild2
<div class="form_item">
<div class="form_element cf_textarea">
<label class="cf_label" style="width: 150px;">Click Me to Edit</label>
<textarea class="cf_inputbox" rows="3" id="text_2" title="" cols="30" name="text_2" ></textarea>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="button_1" type="submit" />
</div>
<div class="cfclear"> </div>
</div>
here is my email-template in motherform
<p>{text_0}</p>
<p>{text_2}</p>
Why does it only send child2 data in my email???
I created new forms with your code; set up the Multi-page plugin; configured an email on the mother; and turned on debug on the mother - nothing else.
Works fine.
Bob
I was thinking ... does it make any sense to make all forms with the wizard editor or without???
Mgringo
i've tried version 3.1 RC5.5 on another site and there was no problem at all 😀
so seems to be a bug in 3.1 RC5.
anyway .... next step for me is to make an update.... Thank you for your time and Help Bob!
Mgringo
I did what was posted in the first message of this thread.
Create 2 forms (Form1,Form2) and a "Mother form" (FormM)
Both form1 and form2 have a submit button
The Motherform doesn't have any html.
the mother form is configured with 2 steps and formnames "Form1,Form2"
All forms are published and i can see the forms when i click the Form1 or Form2 link but when i click the FormM link, i just see the "Powered by ChronoForms" link.
Any idea's why it doesn't work?
Kind regards,
Johan van Leur
Is the <Multi-page plugin enabled in the Mother Form Plugins tab? (if it is the bar should be green with an 'x' icon).
Bob
This was exactly the problem.
I read the first post again but i didn't see that you have to "enable" the plugin on the plugins tab of the mother form.
Thanks for your help.
Kind regards,
Johan van Leur
No problem, it's a common problem. I have added a little code to the plugins so that they tell you if they are enabled or now. Should be in the next release versions.
It's often quite useful to be able to turn a plugin on or off to debug without loosign all the settings.
Bob
I have 2 forms in a multipage plugin attempt. The motherform will be displayed upon clicking the Client Survey link on the left side of the homepagescreen (pls scroll down to see the link).
HEre's the problem: The first form displays ok in a lightbox. But when I click on the Submit button to display the second form, the form is displayed along with the site template: banner, footer, and side menus. I am not sure why since the advice was to insert a submit button on each form to navigate through.
I then tried to enable the option on the mother form to include navigation but no navigation was shown on the forms.
Please help me sort this out. Thx
You're pushing beyond the edges of what ChronoForms can support. I suspect that the problem here is that the &tmpl=component parameter isn't being added to the step urls. At the moment I don't think ChronoForms has any way of dealing with that.
Bob
1. Displaying forms in a lightbox which I've succeeded in doing. The only problem is that using an earlier advice for doing multi-page using collapseItem() and expandItem() methods with <next> and <previous> buttons, all the forms were displayed at once in the lightbox. So I thought maybe I should use the multi-page pluggin as advised by you and Max in earlier postings.
2. Having read and followed your technical piece on using multi-page pluggin, I created the forms I now have. Again, the forms dsiplayed in the lightbox but the second form when called displays with the site template, headers, footer, side menus and all. As you said, CF may not be able to handle this combination of effects (multi-page in a lightbox.
If you should find a way to do this (a hack) I will be greatful to try it. Meanwhile, I will just put both forms as part of a single form since the first form usually behaves as expected.
Thx.
P.S. I hope I can still get help on my related post of having the lightbox displayed with the form via a menu link.
All I really need to do is collect some data from the first form and supply it to the second form, if they fill out the second form.
You can setup an email on the last but one step. That should work OK.
Bob
I am able to get the multi-page forms to work but it duplicates records in the database. Is this a bug in the HTML processing code or is there an different code that will allow us to update the same database record between multi-page forms?
I'll post a fix once I have one. I chatted to Max last week - I think that the problem is that teh current version of the Multi-page plugin forces the field values to be re-published on page load. This is so that the Page Navigation works properly.
However, this also means that the code that we were using to pass other information from one page to the next is now broken.
Bob
I'm using this to create a back button:
<div class="form_item">
<div class="form_element cf_button">
<input value="Previous Section" name="previous" type="button" onClick="window.location='http://www.sitename.com/index.php?option=com_chronocontact&chronoformname=form_mother&cfformstep=1'"/>
</div>
The submit buttons are labeled "Next Section" creating a navigation flow. This works except if you edit the information on the current page and then go back without first submitting (ie. going to the Next Section) then the data doesn't save in the form.
I have tried using type="submit" with the onClick instruction above but I think the multipage plugin overrules the onClick instruction and sends the form to the next page instead. I'm totally new to coding etc but pretty keen to get my hands dirty. Any suggestions?
I'm far from sure how to do this. I think that it has to be a submit button to save the data but I'm then not sure how to make sure that the redirection works. Perhaps you need to detect the button name and set the redirect url appropriately (or it might be better to change the step value stored in the user session).
Sorry to be vague.
Bob
I've reverted to the keep it simple stupid methodology and scrapped the 14 page 200 field form that I was working on. I've since decided that I was asking too much of my users and simplified the form down to one page with a dozen or so fields.
I have created a Joomla registration using chronoform as per the tutorial. Next, I created a child form that allow the user to enter his address detail with 2 fields street name, postal code. I also created a mother form that link to a database named address_data.
So I have the following form:-
Child 1 : Joomla registration (with field name, password, email)
child 2 : user address detail (with field street name, postal code)
mother form
When I tried out the form, right after child 1, the system enter the data into the default Jos_user database. I can also then enter the detail into child 2 form. When I click on submit in child 2, the address data is entered into the database named address_data.
My question are, since the data of one user is entered into 2 separate databases, how does the system link the correct data of one person together? Is there any extra field that I need to pass along into the 2nd database named address_data so that the system would know that John Smith stays at Peter Street with postal code 12345?
Please advise.
Doing the linking is up to you. ChronoForms does offer you a cf_user_id column in the Create Table dialogue that is usually used to store the uer_id. I'm not sure that this will work correctly with a new user registration, you'll need to check.
Bob
What is the code to input Joomla user_id into chronoform cf_user_id?
Do I place the code in the mother form or the child form?
Rgds
Brolin
ChronoForms automatically puts the current user_id into the cf_user-id column assuming that you have this column in your table.
The question is whether CF will correctly pick up the user_id for a newly registered user (I think it will but haven't tested).
Bob
So it would be better for me to let the new user to complete the registration. Once registered, he can then login and update his profile like address, contact number whereby chronform would automatically input his user_id into cf_user_id... provided i have this field in the database.
That would work but it might be better to collect the info first time around. It should work Ok I think.
Bob
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
print_r($session);
?>
What do you want to do with it when you've grabbed it?
I think that ChronoForms populates the $posted array for you, have you checked that?
Bob
- $session
- $posted
In the debug info at the top of the form I can see;
Session data: Array ( [tradingname] => test [contactname] => [mobiletelephone] => [hometelephone] => [email] =>
All I want to do is grab the trading name for example and populate the corresponding input from the form, so the form data is saved when navigating between steps. Unless there is an easier way to achieve this?
I'll need to check. Certainly when you go forward through the form ChronoForms preserves all the data for you. I don't remember testing backward navigation to see what happens.
Bob
I have the same problem as above, I can see the data posted to the child form, but cant get into form display, when I tried to put
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
echo '<div>$posted: '.print_r($posted, true).'</div>';
Result: <?php echo $posted['case_ref']; ?>
?>
then there is nothing displayed even the posted array and word result:
please help me I m stuck with this from last 3 days and now loosing heart.
this is the debug showed when form is running.
Posted: Array ( [REF] => 5 [save] => Submit [79d5153cd3e23bcc51e1b126c0a07440] => 1 [1cf1] => e0c633693153cdad54ee04cd58365ea7 [chronoformname] => View )
Files: Array ( )
Current step: 1
<DIV class=form_item >
<DIV class="form_element cf_dropdown" ><LABEL class=cf_label >Case Reference:</LABEL>
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
$db =& JFactory::getDBO();
$query = "
SELECT *
FROM jos_Case WHERE CASEID= '$posted[REF]' ";
$db->setQuery($query);
$rows = $db->loadObjectList();
foreach ($rows as $row) {
echo "<input value='$row->REF' />";
} ?>
</DIV>
</DIV>
It shows the empty form, Please tell me how to get specific field of one form to other in DB query. Does my code right or not ?
In the latest release I don't think that you need these lines:
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
$posted is already created for you.Other than that I have no real idea what you are doing with all the code you have posted :-(
To learn about the Multi-page plugin use two very simple child form and a mother form. Enable the plugin on the mother form but do not add any html to it.
Get that working then make changes one step at a time.
Bob
I have done what I wanted😀, and I was trying to catch the post variables, but it was overwritten by empty array, that was the way which you told in start of this topic, but it was not mentioned anywhere else that it is obsolete.
but now I have another issue, hope you will also look at it and guide me. I want to change the HTML input value, before submitting data to database, I tried the java script but it override the default chronoform java script.
Is there any other way to do it, or I have to change it in default js file? but I m again afraid if it could implement on all input fields.
please suggest me some solution.
thanks
<?php
$submit = JRequest::getString('submit_s3', '', 'post');
$submit = ereg_replace("[^A-Za-z0-9]", "", $submit);
if($submit=="NextPage") {
header('Location: index.php?option=com_chronocontact&Itemid=60&cfformstep=4');
}
else {
header('Location: index.php?option=com_chronocontact&Itemid=60&cfformstep=2');
}
?>
The only issue I come across now is on the last form of the "multipage form" is that if you click previous the form gets submitted anyway.
This is the code (after email) on the last step, if I add this before email is sent then I get a blank page. Any suggestions? Is there a way I can manually submit the form ?
<?php
$submit = JRequest::getString('submit_s5', '', 'post');
$submit = ereg_replace("[^A-Za-z0-9]", "", $submit);
if($submit=="PreviousPage") {
header('Location: index.php?option=com_chronocontact&Itemid=60&cfformstep=4');
}
?>
$cf->submitform();
This form has 10 steps, but not all required. It's a team registration form, so each step is the same except for the first. Does each step have to receive info for the form to work? Or can they enter say 4 names and press the button to reach the end?
I've never tried to do one of these using the multi-page plugin. I think that it is probably possible to change the number of steps in mid-stream but I'm not sure how to code that off the top of my head.
Bob
PS I did do one that used JavaScript to auto add blocks of fields.
I've been working hard with chronoforms to get a three step form with a final confirmation page and would like to share my learning with the Community.
I've tried using both at the same time multi-page pluging and confirmation-page plugin. That didn't work resulting several irresolvable errors (check posts from topic 'Using the Multi_page Plugin).
Anyway, I thank everybody in the community cause their participation has served me a lot.
After 3 days testing and checking I got what I wanted: A multi-page form with confirmation page, storage in DB and email sending.
This is, step by step, how to create that:
1º Create four forms with the following specifications
[list]
Create form1 (first child form):
- 'field1' (textBox)
- 'check0' (CheckBox)
- 'upload' (FileUpload)
- Captcha
- Submit and Reset Button
Publish it.
Set FileUpload configuration in form1.
Set Captch configuration in form1.
Create form2 (second child form):
- 'field3' TextBox
- 'field4' TextBox
- 'field5' TextBox
- Submit and Reset Button
Publish it
Create form3 (confirmation page):
- Submit Button
Setup email configuration in this form.
Set a redirect url (if you need it) in this form, for example: http://www.mysite.com/index.php?option=com_content&view=article&id=100
Publish it
Create mother_form with no code at all (mother form):
Publish it
[/list]
2º Create a multi page form: link form1, form2 and form3 to mother form
[list]
- Get checked mother_form on Forms Manager Panel. Click on Multi Page Plugin at the left side of the panel.
- Set the plugin with the following parameters:
Number of Steps: 3
Step form names: form1,form2,form3
Finalize button name: Finish
Enable Steps navigation: no
Debugging: no
- Click on mother_form at Forms Manager Panel.
Go to Plugins Tab and enable Multi Page (set the Multi Page row to green with an 'x').
[/list]
3º Create a DB where form data will be inserted
[list]
- Get the mother_form checked on Forms Manager Panel and click on 'Create Table' (at the top).
- Click on the 'v' in 'Field name' row, so all the rows get green and with the 'x' at the end of the row. Then save.
- Go to DB Connection, enble Data Storage and select jos_chronoforms_mother_form on the Tablename(s) list.
[/list]
4º Make the confirmation page with form3
[list]
- You can use the following code at the beginin of form3 (in 'Form HTML') to display the data filled in by the user.
<?php
if (isset($posted['field1']))
{
$field1=$posted['field1'];
}else{
$field1='';
}
echo 'This is the data you put in field1: '.$field1.'<br/>';
?>
Now you can display the rest of the fields using analogue code.
[/list]
5º Add the 'Back' button to the confirmation page
[list]
- Just put the following code at the place you want your back button:
<div class="form_item">
<div class="form_element cf_button">
<input value="Previous Section" name="previous" type="button" onClick="window.location='http://www.mysite.com/index.php?option=com_chronocontact&chronoformname=mother_form&cfformstep=1'"/>
</div>
This code not only will let you start from the form1, it also shows the preceding forms filled with the original data provided by the user (you'll have to enable the 'Try to republish' in every form).
(This information has been taken from viewtopic.php?f=9&t=14744&p=43587&hilit=window.location#p43587, thanks to BigCol)
One more thing: don´t use á, é, º, ª,... or some strange characters in the codification of your forms.
Replace them by their corresponding html entities or your filds won't be properly republished when the 'back' button is clicked. For example, "1º" insetad of "1º".
[/list]
That's all.
Thanks a lot to the Community and hope it will serve you.
Thanks again mate, nice one
Al
when i click on the "back" button, i get back to a empty form.
Sounds as if you may have missed this part
(you'll have to enable the 'Try to republish' in every form).
Bob
though i did set "try to republish" on both child forms, and mother forms.
I've also paid attention so there are no accents in the form html (it's a french form)
:\
I'm stilling having issues trying get multiple pages to deposit into a single database entry. I've found various posts with different types "solutions" throughout this long thread, but most are for older versions of the component and none seem to work. I'm getting each page posting to the database, but they're all posting their own entries - not all in one single entry. If anybody could let me know what you're using to make that happen, I would be most appreciative.
Also, I used the walkthrough a few posts back to set up the multi_page, and while I got the "Previous" page button to work, the fields aren't filled. Will that occur when the pages are inserted into the database correctly?
[list]
Bob
In the last one I built (which was a while ago) I used this code in the Form HTML of Steps 2, 3, 4 . . .
<?php
$MyForm =& CFChronoForm::getInstance();
$data = $MyForm->tablerow['jos_chronoforms_table_name'];
?>
<input type='hidden' name='cf_id' value='<?php echo $data->cf_id; ?>' />
Bob
PS Change 'jos_chronoforms_table_name' to match your table name
Fatal error: Class 'CFChronoForm' not found in /home/heartsom/public_html/administrator/components/com_chronocontact/admin.chronocontact.php(2736) : eval()'d code on line 2
Hmmm . . .
Please try adding this line
<?php
require_once( JPATH_COMPONENT.DS.'libraries'.DS.'chronoform.php');
$data = . . .
Bob
Warning: require_once(/home/account/public_html/administrator/components/com_chronocontact/libraries/chronoform.php) [function.require-once]: failed to open stream: No such file or directory in /home/account/public_html/administrator/components/com_chronocontact/admin.chronocontact.php(2736) : eval()'d code on line 2
Fatal error: require_once() [function.require]: Failed opening required '/home/account/public_html/administrator/components/com_chronocontact/libraries/chronoform.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/account/public_html/administrator/components/com_chronocontact/admin.chronocontact.php(2736) : eval()'d code on line 2
I imagine it's because the code trying to look for chronoform.php in the administrator directory, instead of the components directory. So, I changed
require_once( JPATH_COMPONENT.DS.'libraries'.DS.'chronoform.php');
to
require_once( JPATH_COMPONENT_SITE.DS.'libraries'.DS.'chronoform.php');
That worked without errors.
So, now I have the following inserted in the first step:
<input type='hidden' name='cf_id' value='<?php echo $data->cf_id; ?>' />
And the following inserted in the second step:
<?php
require_once( JPATH_COMPONENT_SITE.DS.'libraries'.DS.'chronoform.php');
$data = $MyForm->tablerow['jos_chronoforms_international_app'];
?>
<input type='hidden' name='cf_id' value='<?php echo $data->cf_id; ?>' />
When I submit the first step, it continues on to the second step and creates a record (Record 1). When I submit the second step, it does include all the first step's fields, but it's still in a separate record (Record 2). So, Record 1 contains all the first step's fields, and Record 2 contains all the first and second step's fields. I had hoped that the second step's information would be inserted into Record 1, without a Record 2 being created (having a 6 page form, a ton of records would be created). Is that what's supposed to be happening, or is this the best I can expect?
If you have any PHP in your Form HTML it's wise to preface it with
<?php
if ( !$mainframe->isSite() ) { return; }
. . .
to prevent ChronoForms trying to execute it when the form is saved.Bob
For some reason however, it still doesn't seem to be pulling the cf_id.
When I look at the source code in the second step, it shows the hidden field as:
<input type="hidden" name="cf_id" value="" />
So the cf_id is not getting inserted into the hidden field. The code I have at the top of the form is:
<?php
require_once( JPATH_COMPONENT_SITE.DS.'libraries'.DS.'chronoform.php');
if ( !$mainframe->isSite() ) { return; }
$data = $MyForm->tablerow['jos_chronoforms_international_app'];
?>
<input type='hidden' name='cf_id' value='<?php echo $data->cf_id; ?>' />
I must be missing something, but I can't figure out what it is.
Don't know what the problem is here. I checked on one of my forms this morning and this code appears to work OK
<?php
if ( !$mainframe->isSite() ) { return; }
$MyForm =& CFChronoForm::getInstance();
$data = $MyForm->tablerow['jos_chronoforms_table_name'];
?>
<input type='hidden' name='cf_id' value='<?=$data->cf_id?>' />
where 'jos_chronoforms_table_name' needs to exactly match the name of your database table.
Bob
How can I tell if I have the latest version of the multipage plugin? And if it is not the latest version where would I get the latest version so I can install it?
Thanks
Rowby
I tried to check through the forum, if this question was answered already, but did not find anything related (maybe too blind :-)
I need to implement BACK button for each multipage child page and wondering, if this is supported already? If not any hints how to code it the best way.
Thanks guys.
Ciao
Eki
I think that if you turn on Forms Navigation in the plugin configuration then you can use links with step names in them. Then you cna use a button on Step 2 with an action to go to some_url . . .&step=1
Bob
Did you see my earlier post about how I can tell if I have the latest version of the muli-page plugin?
Do you know how I can see what version I have? Or is it tied into the version of Chronocontact.
I have installed 3.1 RC5.5 of Chronocontact. Would that automatically give me the "lastest" version of multipage plugin?
Thanks!
Rowby
Hi Eki,
I think that if you turn on Forms Navigation in the plugin configuration then you can use links with step names in them. Then you cna use a button on Step 2 with an action to go to some_url . . .&step=1
Bob
Hi Eki,
I think that if you turn on Forms Navigation in the plugin configuration then you can use links with step names in them. Then you cna use a button on Step 2 with an action to go to some_url . . .&step=1
Bob
Thanks Bob, this did the trick. I'm using &cfformdata=n. Data seems to be posted in session data between page navigation, but not put back into actual editable fields. Any idea how I can put them there....?
Have a good vacation!
Regards,
Eki
I think that ChronoForms puts the data in a $posted array so you'd need to set the values from there.
Bob
effect('background-color', {wait: false, duration: 100}).start('FFAEA5','FFAEA5'); } }); }); $$('.emailitem').each(function(item){ item.removeEvents(); }); //var counter = 0; $$('.emailitem').each(function(item){ item.addEvent('mousedown', function(e) { e = new Event(e).stop(); var clone = new Element('div', {'class':'emailitem'}).adopt( new Element('span', {'id':this.getFirst().getProperty('id')}).setText(this.getFirst().getText()) )//this.clone() //var clonetext = new Element('span', {'id':this.getFirst().getProperty('id')}).injectInside(clone); .setStyles(this.getCoordinates()) // this returns an object with left/top/bottom/right, so its perfect .setStyles({'opacity': 0.7, 'position': 'absolute'}) .addEvent('emptydrop', function() { this.remove(); $ES('div[class=cf_email]', $('left_column2')).each(function(droparea){ droparea.removeEvents(); droparea.addEvent('click', function() {
This is when you edit the Mother form in the Form Editor?
We have had occasional reports of this happening on some forms or for some users on all forms. As far as I know Max hasn't yet managed to find out what casues it :-(
Bob
thanks!
Sean
HI....I have a problem that can probably be resolved quickly. I am using steps navigation, and I want to reset and remove one of the items in the $posted array. unset() doesn't seem to do the trick. any ideas?
thanks!
Sean
waiting help as well...
The $posted array is copied from the session info so changing it won't have any effect. You can't eaily unset it but you could set it to a blank value with a hidden input in your form, that will overwrite the saved value when the form is submitted.
Bob
one more question. I have enabled browser caching in the multi-page form so a user can navigate back to previous pages. however, when a user changes something on a previous screen and hits submit, he jumps as if he was submitting from the page he/she was on before hitting the back button. can you reset the step number on the page to make sure you will submit to the expected next step? make sense?
Sean
unset($posted['field_name']);
$session =& JFactory::getSession();
$session->set('chrono_formpages_data_mom', $posted, md5('chrono'));
Chris
I need content of multipage-form in email template, i cant be sent to DB.
I have mother and child forms, but child forms have their own email templates and i need only one output not 7, how is that possible ? where i need put whole template ? (because of export -
[[EXPORT]]
[[meno]]{meno}[[/meno]]
[[priezvisko]]{priezvisko}[[/priezvisko]]
[[titulpred]]{titulpred}[[/titulpred]]
etc.
or the possibility of the required fields blank form that arent filled or bad filled that jumped on the highest required field blank (or bad fill item of form) thankou very much
To get a single Email you need to use the Mother Form to send the email.
Bob
1-7 forms have their own email template. I need to split up that templates in mother form ?
My mother and child forms sending 7 emails separately not in one email template and that is big problem for me 😟
Turn off the emails for all of the child forms.
Build a single Email Template in the mother form.
Bob
Thank you guys for all of this info. I will fuddle through it, it's starting to make sense little by little - as is the case for the past year I've been online...learning soooo much! It's amazing how much there is to learn and how much you can learn from forums with awesome people in them.
I absolutely love forums. They are a life saver to the newbie.
Thanks again.
I have Chrono Contact 3.1 RC5.3 on one domain and Chrono Contact 3.1 RC5.5 on other.
I describe problem with situation (RC 5.3 is CH 3.1 RC5.3 etc.)
on RC5.3 i have mother and child forms and they are O.K.
i do the same procedure to setup multipage forms set on RC5.5 but there is only white page and link powered by CHF.
I thought that I doing something wrong, so I try put RC5.3 mother form with RC5.5 child forms together, RC5.3 child forms with RC5.5 mother form together, RC5.3 mother form and RC5.3 child formulars together restored in RC5.5 Chronoforms and still there are white page - it did not work either in one of these cases. What is problem with making my forms multipage in RC5.5 ?
RC5.3 could be good too, but there is blue window at the bottom of each child formular with text
1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array
and after submiting last child form clients see my email template completed with their data, i need after sumbiting last child formular just thank you page.
thank you very much for help
I don't know of any difference between 5.3 & 5.5 that would cause this. I no longer remember which version the plugin was built for. Overall 5.5. is the release that you should be using.
The messages in a blue block are the standard ChronoForms debug messages so you have debug turned on in one or more of your forms.
Bob
Why is there white page in RC 5.5 without forms html code ?
If not this problem in RC 5.3 :
Why after submiting last child form clients I see my email template completed with data, i need after sumbiting last child formular just thank you page, not template😟
It will be great
Why is there white page in RC 5.5 without forms html code ?
Impossible to say without seeing the form.
Why after submiting last child form clients I see my email template completed with data
Because you have Debugging turned on for one or more of the forms.
Bob
i have another problem:
I need back button - make it work, but if i clicked od back, i have my form cleared and without of content of the form. I enable - Republish fields if error occured- try to republish on all child and mother forms and checked whole chronoengine forums but i cant see solution for my problem.
Can you checked it please?
Thank you very much
There's nothing to download - it comes installed with ChronoForms. Please check the plug-ins column to the left of the Forms Manager view.
Bob
thanks!
A normal 'submit' button will work as a Nect button. The Back button you can create using the 'steps navigation' feature.
Probably best to start out with the standard ChronoForms Anti-spam imageverification on the first step form (not on the mother form).
Bob
The last step I am trying to accomplish is to keep each pages data in the array - I do not have a DB set-up nor do I need to.
I am still trying to figure how the part you refer to works "access the data from previous steps from the session using"
<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
?>
My goal is to try an protect from people going forward and back in the form and loosing there data entered thus far.
Form is here - https://www.communitychoicecu.com/index.php?option=com_chronocontact&chronoformname=LoanAppTest
Any help is appreciated.
If you are using the Multi-page plug-in then ChronoForms is already saving the data into the session; you don't need to replicate this.
The "Steps navigation" allows you to move around the pages/steps by adding e.g. &cfformstep=2 to the form URL.
Bob
Is there something I need turn on for the fields to stay populated/or repopulate?
Thanks
Posted: Array ( [uuid] => mnag001 [eid] => mnag001@gmail.com [amount] => 500 [currency_code] => USD [chrono_verification] => s8ftv [undefined] => Send Now [732efe1e0496f0e546f7523899ccfbef] => 1 [1cf1] => 101e1db0aa7ad96d560f885f95a061c6 [chronoformname] => mother )
Files: Array ( )
Current step: 1
Fatal error: Call to a member function bind() on a non-object in /home/itouch/public_html/components/com_chronocontact/libraries/customcode.php(71) : eval()'d code on line 13
I am getting this error.
Mother Form > 2 Child Step
I have verified the each form. Both work fine but I putted in Multiform it doesn't work and Got error.
Please help me someone.
thanks in advance.
This error is usually from a problem with the database table you are trying to save to. Either the table doesn't exist or one of the column names (and/or the form input names) includes a dash, space or some other special character.
Bob
PS You need to refresh the DB Connection after any changes to database column names. In the Form Editor click the DB Connection tab and set the Connection to 'No'. Click the 'Apply icon in the toolbar to save the form, open the DB Connection tab, set the Connection back to 'Yes' and re-save the form. This will refresh the copy of the table information that ChronoForms uses.
In the general settings of you daughter forms make sure you have the following settings:
Under Other Form Settings:
Republish fields if errors occurred: Try to republish
Renew Form Instance On Submit: Same Instance
Hope this helps.
I am still having trouble with this.
I have two child forms,
one empty mother form.
in the mother form all plugins, including multi-page are checked green.
checking the motherpage+multi-page plugin in the form manager.
when I open the mother form link, I see it empty.
also, does this plugin include a <back button? I saw an option for what i thought was browsing forward/backwards but i don't see any of this in the forms.
I am having another problem which may be related (?). when i create a table in the DB for a form, and add a field, when i save and later come back to edit that table, i see the field i have added as disabled.
thanks,
Ilan
in the mother form all plugins, including multi-page are checked green
Don't' ever check them all - just the ones that you actually want to use. Otherwise they all try to run and your form gets in a mess.NOTE: green **bars** are enabled, red bars with green ticks are disabled.
Bob
I followd the steps. Created Child1, Child2, Child3, and Mother forms. Is the mother form suppose to be blank? I tried both ways. Blank and with a submit button.
I checked Mother form and clicked Multi Page. I put number of steps 3, and form names Child1,Child2,Child3. I named Final button 'and finally'. Saved it and clicked the mother link. Did NOT see the steps. I only saw the mother form.
Don't know what went wrong. I did the whole process 3 times just to be sure but same result all the time.
Can you help?
Have you enabled the plug-in on the Mother Form Plug-ins tab?
Bob
Yes, the plugin is enabled.
The email is not enabled in any of the forms.
Below are the links: These form are just practice forms. Once i know how to do the multi page i will make the proper one.
Link For the mother form:
http://totalukfinance.com/index.php?option=com_chronocontact&chronoformname=Mother
Link for Child1 form:
http://totalukfinance.com/index.php?option=com_chronocontact&chronoformname=Child1
Link for Child2 form:
http://totalukfinance.com/index.php?option=com_chronocontact&chronoformname=Child2
Link for Child3 form:
http://totalukfinance.com/index.php?option=com_chronocontact&chronoformname=Child3
I don't see anything wrong there except that the Mother Form seems to be tucked into the left column. Have you placed it in a module? If so please test first with the default link. I'm not certain that the Multi-page plug-in will work correctly from a module.
Bob
Thanks for the advise. I did try to put the form in a different page. It works individually but not as a Multi form. You are right, It did not work in a module.
What else can I do?
By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.
Bob
I read in the debug info:
Pages: Array ( [0] => title_plan [1] => contact_details_plan [2] => confirm_test )
How can I print title_plan on the form page? In other words: What code I need in order to print the name of the first form on the screen? I will need to use this name later in the cycle.
Thanks a lot
Bob
I rephrase the question: How could I put the name of the actual child form into one of the hidden fields?
Thanks
Bob
How could I put the name of the actual child form into one of the hidden fields?
That one is much easier<input type='hidden' name='title_1' id='title_1' value='<?php echo JRequest::getString('chronoformname', '', 'get'); ?>' />
Bob
Thanks for the help but unfortunately this does not work. My hidden field remains empty. I tried to test around and the issue is with this bit: JRequest::getString('chronoformname', '', 'get');
Have you got any more thoughts?
Thanks
Bob
The code looks OK to me - what is the URL of the page when the form is loaded?
Bob
It's been solved.
Regards
Bob
Hi Bob,
The code looks OK to me - what is the URL of the page when the form is loaded?
Bob
I've a problem using ChronoForms with Multi_page plugin. I need to setup a page to collect donations for a nonprofit organization. I need to save the form values to the site database and then send the same data to payment system which only accepts the HTTP POST method.
So I've created a mother form and two sons, the first one to save data and the second one get the same data back and send them to the bank, but I don't understand where I can set the "action" url value for sending POST data. If I set it in the mother form, the data are sent when I submit the first form and are not saved, if I set it in the second "child", the value is overwritten by the "mother" form.
I cannot use the redirect plugin, because I need to use POST, nor cURL plugin, because users must be directed to the payment site to complete the check out.
Is there a way to set manually the "action" url for the last child in a multi_page module?
Thanks.
CA
Unfortunately this path is messy.
You can't redirect the user with a Post transaction without creating a form to submit :-( There are two ways that I have seen users do this. Both involve creating a second form usually in the ChronoForm OnSubmit After box (though theoretically you could use another ChronoForm).
Method 1 is to use a JavaScript snippet in the form so that it autosubmits when the ThankYou page is loaded.
Method 2 is to show the user a confirmation or Pay Now button to get them to submit the second form from the Thank You page - this has the advantage that you can show a message and the disadvantage that it requires user action. (I guess that you could build in a short delay to the autosubmit version to get the best of both worlds.)
In either case the form will have the other site URL as the action and the data you need to pass in hidden inputs.
Bob
Method 2 is to show the user a confirmation or Pay Now button to get them to submit the second form from the Thank You page
Yes, it works!!
I've used this method to give the users the chance to check and confirm the payment.
Thank you very much.
CA
Why is this? Here is the debugging on the form.
$params: JParameter Object ( [_raw] => stepscount=3 formsnames=appstep1r,appstep2,appstep3 finalbuttonname=Finish your application debugging=1 onsubmit=before_email [_xml] => [_elements] => Array ( ) [_elementPath] => Array ( [0] => /srv/www/goinvictus.com/public_html/libraries/joomla/html/parameter/element ) [_defaultNameSpace] => _default [_registry] => Array ( [_default] => Array ( [data] => stdClass Object ( [stepscount] => 3 [formsnames] => appstep1r,appstep2,appstep3 [finalbuttonname] => Finish your application [debugging] => 1 [onsubmit] => before_email ) ) ) [_errors] => Array ( ) )
formname: InvictusCorporate
Pages: Array ( [0] => appstep1r [1] => appstep2 [2] => appstep3 )
Current step: 1
Session data: Array ( )
I can’t see any obvious reason for this. The form itself looks good. I'm trying to think what might cause this:[list]
By all means email or PM me the site URL and a SuperAdmin login if that's permitted and I'll take a quick look.
Bob
Yes but it's 10pm here so I won’t be looking until the morning :-(
Off to watch some TV.
Bob