Forums

Using the Multi_page Plugin

GreyHead 16 Jun, 2009
Hi,

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
maxxoros 17 Jun, 2009
Hi

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🙂
GreyHead 17 Jun, 2009
Hi maxxoros,

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
dangee 18 Jun, 2009
Hey,

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...
GreyHead 19 Jun, 2009
Hi dangee,

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
dangee 19 Jun, 2009
yep, i think it would be more user-friendly with javascript, exept i don't know how to do it🙂...so if anyone can help...
NickC4555 24 Jun, 2009
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?
ddoughty 25 Jun, 2009

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.
ddoughty 25 Jun, 2009
quote]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.[/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.
chumby 26 Jun, 2009
Hi all,

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....
NickC4555 26 Jun, 2009

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.
Max_admin 26 Jun, 2009
@ddoughty, add them through phpMyaDmin or wait the next release which will get your the child forms fields names automatically!

@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
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
chumby 26 Jun, 2009
Thanks 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
chumby 28 Jun, 2009
HI Max,

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
ddoughty 28 Jun, 2009
@admin

Thanks. When is the next update coming out? I don't really know how to mess with phpMyAdmin really at all.
Max_admin 30 Jun, 2009
@Chumby, are you sure you enabled emails at the mother form general tab ? I don't think so!

@ddoughty, the new release is ready and will be available in the downloads today!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
chumby 30 Jun, 2009
HI 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
ddoughty 01 Jul, 2009
Ok, so I checked the mother form and created database. Then i made connection to that database. Now I get the following when submitting the final form:

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!!
chumby 01 Jul, 2009
Gotcha Max... see the enable option now (was hidden under a pop up).

Will keep working on it... thanks Max

cheers
Chumby
camerata 13 Jul, 2009
Hi, I'm interesated about this feature. I'm not sure if it will work fine for me.
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?
GreyHead 13 Jul, 2009
Hi camerata,

$posted['field_name']

Bob
camerata 13 Jul, 2009
Thanks. I did wait for your reply.
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.
GreyHead 13 Jul, 2009
Hi camerata,

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
camerata 13 Jul, 2009
Field re-named to 'test'.

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?
camerata 13 Jul, 2009
Code from debug mode.

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.
reaves_code1 13 Jul, 2009
Hi,

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
camerata 13 Jul, 2009

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.
camerata 14 Jul, 2009
My Goal: Show form2 with editable default values from an external table depending of form1 data.

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.
Peet 14 Jul, 2009
Hey Greyhead/Max/All, great that you put this page up, been rather frustrating with the multi page plugin. I have a multi page form that does nothing special, the fields contained within them are of type date, text, smallint and varchar. I followed the steps outlined here to a tee and have as yet had no success saving any data to the database. As a brief overview, I have

[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?
camerata 14 Jul, 2009
More progress...

The problem is wizard. Fields in wizard form seems blocked.
Peet 14 Jul, 2009
I recreated the entire multi form from scratch, go figure, it's working. One word of caution I would add for anyone working with this plugin, if you use the Form Wizard for any form creation/updates/edits. Saving forms with the Wizard will change/revert some of your code back to defaults. As an example if you have multi form enabled and your post data button is named e.g. but_postdata, opening and saving the form that contains that button in the Wizard will rename the button and your post won't work. One quick question? I have a drop down box in one of my forms that is being loaded by a database call, it fills the drop down perfectly, however the data that is saved to the database is truncated. The value in the drop down is a persons full name e.g. John Smith, the value saved in the database is John, same variable is used, help?
GreyHead 14 Jul, 2009
Hi Peet & Camerata,

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
reaves_code1 14 Jul, 2009
Hi Greyhead,

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?
gingabox 15 Jul, 2009
Hi Max and Greyhead
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:
GreyHead 15 Jul, 2009
Hi gigabox,

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
gingabox 15 Jul, 2009
OOOOOOOK now I feel like a low life haha... I missed one of them under Setup Emails... goo

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!
GreyHead 15 Jul, 2009
Hi gingabax,

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
gingabox 15 Jul, 2009
OK, actually, I am wrong, I still have a problem... I do get the email but only including the Form3 fields...

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
gingabox 15 Jul, 2009
ORRRR do emails need to be enabled for each child? maybe that is my cause?

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...
GreyHead 15 Jul, 2009
Hi gignabox,

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
gingabox 15 Jul, 2009
Ok there we go... that worked a charm.

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)
Peet 16 Jul, 2009
Hey guys, note for newbies, I wasted a lot of time on this. The ONLY form that needs to be connected to the database, if you're using the save data function, is the mother form.

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...
GreyHead 16 Jul, 2009
Hi Peet,

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 like
print "<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=John

Better 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 use
print "<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
Peet 16 Jul, 2009
GreyHead, you are the man, :? all that time and I didn't notice the motherform connection only post, can't see the forest for the trees sometimes eh? Thanks for all your help, best money I've spent for a long time getting the license. RE the MOOTOOLS, ChronoForms will work definitely with version 1.11, perhaps with ver 2 of MOOTOOLS? One more quick question? I've got my multi form page working great, have used some of your other posts to customise the errors e.g.
<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
GreyHead 18 Jul, 2009
Hi Peet,

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
cesarscav 26 Jul, 2009
Hi all
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
GreyHead 27 Jul, 2009
Hi 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
cesarscav 27 Jul, 2009
Hi 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?
cesarscav 27 Jul, 2009
Just in case that is needed
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
GreyHead 27 Jul, 2009
Hi Cesar,

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
cesarscav 27 Jul, 2009
I went to phpmyadmin and i can see on the jos_session in the data field all the values for my session

__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
GreyHead 16 Aug, 2009
Hi cesar,

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
cesarscav 17 Aug, 2009
Hi 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]
?
GreyHead 17 Aug, 2009
Hi Cesar,

I don't think it will work, test by commenting out the lines with // at the beginning to see what happens.

Bob
jenstechs 29 Aug, 2009
I feel just like Nick...

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!!
jenstechs 29 Aug, 2009
Sigh. Nevermind. I was VERY confused by all the green/red checks/xes in the "Plugin" tab for the form.

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...)
GreyHead 30 Aug, 2009
Hi jenstech,

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
jenstechs 31 Aug, 2009
Sorry, I'm running in small crisis mode right now... if anybody is around on Instant Message that'd be greaaat....

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........
GreyHead 01 Sep, 2009
Hi jenstech,

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
jenstechs 01 Sep, 2009
Aha, thank you Bob!! You're right, it is passed through automatically! Now I can get the proper data! And referencing the field names in the parent code (email templates/database connection) works automatically as well.

What a brilliant little plugin!
mingus 03 Sep, 2009
Hi
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
GreyHead 03 Sep, 2009
Hi Luca,

The child forms as far as I recall.

Bob
HSN 07 Sep, 2009
Hi All,

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,
GreyHead 07 Sep, 2009
Hi HSN,

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
HSN 07 Sep, 2009
The Radio button is an interesting choice which would yield further questions.

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 ?
HSN 08 Sep, 2009
Bob,

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,
GreyHead 08 Sep, 2009
Hi HSN,

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
HSN 08 Sep, 2009
Ahh,

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 ?
GreyHead 08 Sep, 2009
Hi HSN,

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
ve6sar 08 Sep, 2009
Hi I'm trying to develop a simple app using chrono forms for our employees to submit daily times for them selves, equipment they used, and billing info as one multi-page form to reduce the amount of duplication of data entry they have to do.

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
GreyHead 08 Sep, 2009
Hi Sean,

Please check the first few posts in this thread which talked about saving after each step.

Bob
ve6sar 09 Sep, 2009
Hi 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
jenstechs 09 Sep, 2009
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
GreyHead 10 Sep, 2009
Hi Sean,

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
ve6sar 10 Sep, 2009
I've tested it with each form having the DB connection turned on and the same table selected as the parent form. I'll try the code snipet next and see if that works.

Thanks for the help guys.

Sean
ve6sar 10 Sep, 2009
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
ve6sar 10 Sep, 2009
Had to go into the database to add the code block and it still doesn't save the intermediate steps. I'll just have to add custom code to write the data to the database.

Sean
HSN 13 Sep, 2009
Hi Bob,

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
GreyHead 13 Sep, 2009
Hi 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
HSN 13 Sep, 2009
I think a wise person once said, prevention is better than the cure.

Forgot who it was though🙂
HSN 18 Sep, 2009
Hi Bob,

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,
GreyHead 18 Sep, 2009
Hi HSN,

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
SunPoweredProductions 24 Sep, 2009
Captcha Verification & Multi_page

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
laustin 03 Oct, 2009
Hello all,

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!
GreyHead 04 Oct, 2009
Hi laustin,

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
laustin 04 Oct, 2009
Hi 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!
GreyHead 04 Oct, 2009
Hi laustin,

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
laustin 04 Oct, 2009
Hi 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!
laustin 04 Oct, 2009
Hi Bob,

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!
laustin 04 Oct, 2009
Hi Bob,

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.
GreyHead 04 Oct, 2009
Hi laustin,

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
laustin 04 Oct, 2009
Hello all,

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!
laustin 05 Oct, 2009
I figured out another solution to passing field data from form to form. First, you put in
$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!
laustin 05 Oct, 2009
I forgot to add that to access the $cf_id in the next form, you need to put a hidden field in the first form.
<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'];
SunPoweredProductions 05 Oct, 2009
Dear Greyhead or other chronoforms admins,

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.🙂
Mgringo 06 Oct, 2009
Hi Bob,

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!
GreyHead 06 Oct, 2009
Hi Mgringo,

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
Mgringo 06 Oct, 2009
Hi 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?
Mgringo 06 Oct, 2009
Hi Bob,

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!
GreyHead 06 Oct, 2009
Hi Mgringo,

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
Mgringo 06 Oct, 2009
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
GreyHead 06 Oct, 2009
Hi Mgringo,

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
Mgringo 06 Oct, 2009
hi Bob Oke thats almost working! still that it doesn't send data from form1 It gives back the {field_name} syntax. In debug after submitting form1 it shows the data, but after filling form2 it shows the {field_name} syntax
GreyHead 06 Oct, 2009
Hi Mgringo,

Hmmm . . . odd, almost midnight here, I'll check in the morning.

Bob
Mgringo 06 Oct, 2009
Thanks it would be great ....
GreyHead 07 Oct, 2009
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
Mgringo 07 Oct, 2009

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
GreyHead 07 Oct, 2009
Hi Mgringo,

Yes; there are no email Setups in either child, just in the mother.

Bob
Mgringo 07 Oct, 2009
What version of Chronoform do you have??? I use 3.1 RC5
GreyHead 07 Oct, 2009
Hi Mgringo

3.1 RC5.5

Bob
Mgringo 07 Oct, 2009
Bob Last try!

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???
GreyHead 07 Oct, 2009
Hi Mgringo,

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
Mgringo 07 Oct, 2009
hmmm strange, could there be abother problem??? like server problem?
Mgringo 07 Oct, 2009
Bob,

I was thinking ... does it make any sense to make all forms with the wizard editor or without???

Mgringo
Mgringo 07 Oct, 2009
Bob,

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
gaze 22 Oct, 2009
Hi There,

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
GreyHead 22 Oct, 2009
Hi Johan,

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
gaze 29 Oct, 2009
Hi,

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
GreyHead 29 Oct, 2009
Hi Johan,

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
obisi7 30 Oct, 2009
My url is http://ipatrivers.rvha.gov.ng/park

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
GreyHead 30 Oct, 2009
Hi obisi7,

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
obisi7 30 Oct, 2009
Bob thx for your quick response. I was only trying to combine solutions from 2 threads in this forum:

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.
tadosborn 06 Nov, 2009
Is it possible to make the last step of a multi form step optional? If so, how? I need to receive the email for the second to last form regardless if they submit for the last form.

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.
GreyHead 09 Nov, 2009
Hi tadosborn,

You can setup an email on the last but one step. That should work OK.

Bob
tadosborn 09 Nov, 2009
Can someone please post the snippet of code to replace the bad code in this thread for updating the same record in a database table for multi-page forms? The provided code does not work!

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?
GreyHead 09 Nov, 2009
Hi tadosborn,

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
BigCol 23 Nov, 2009
I'm playing around with the navigation options on the multipage form.

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?
GreyHead 23 Nov, 2009
Hi BigCol,

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
BigCol 24 Nov, 2009
Thanks for the prompt reply.

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.
brolin 05 Dec, 2009
Hi,

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.
GreyHead 06 Dec, 2009
Hi brolin,

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
brolin 06 Dec, 2009
Hi,

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
GreyHead 06 Dec, 2009
Hi 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
brolin 08 Dec, 2009
Hi 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.
GreyHead 08 Dec, 2009
Hi brolin,

That would work but it might be better to collect the info first time around. It should work Ok I think.

Bob
mr_bell 09 Dec, 2009
I am guessing that this is the correct place to ask the following question. I have a 10 step mutli form setup working how I wish. I am now planning to grab the data already posted so a user can navigate between steps. I am using the code below to grab this however it returns a blank array. I have debug running at the same time and the posted data is displayed, so what am I doing wrong with regard to accessing the form data?

<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
print_r($session);
?>
GreyHead 09 Dec, 2009
Hi mr_bell,

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
mr_bell 10 Dec, 2009
Tried both "print_r" for;
- $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?
GreyHead 10 Dec, 2009
Hi mr_bell,

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
mr_bell 10 Dec, 2009
I have enabled the setting for Republish fields if error occured for each step and it seems to be preserving the data whichever way you navigate. This is perfect I think I will need to adjust the session timeout and add some extra javascript to account for it but it seems to work!
farzananosheen 09 Jan, 2010
Hi,
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.
farzananosheen 09 Jan, 2010
Hi again,

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
farzananosheen 09 Jan, 2010
I want to get the varibale from mother form and put it into the DB query to execute , here is my code,

<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 ?
GreyHead 10 Jan, 2010
Hi farzananosheen;

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
farzananosheen 13 Jan, 2010
Hi 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
mr_bell 10 Feb, 2010
I am still tinkering with getting these Multi-page forms set-up, I now have the navigation working fine using the following;

<?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');
}
?>
mr_bell 17 Feb, 2010
Ok let me re-phrase what I'm trying to do. I think if you can remove "Finalize button name" from the multipage plugin settings. Then on the last step of your form add something similar to if the correct button is clicked. Would that work?

$cf->submitform();
mr_bell 18 Feb, 2010
Got this working in the end with a little hacking... will write a blog post about getting the multiform setup with navigation to explain how I went about it :-)
GreyHead 18 Feb, 2010
Hi mr_bell,

Excellent. I look forward to it.

Bob
tedZilla99 15 Mar, 2010
OK I'm finally plugging away on this multipage form - one question:

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?
GreyHead 15 Mar, 2010
Hi tedzilla99,

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.
afernandez137 19 Mar, 2010
Hi everybody.

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.
GreyHead 19 Mar, 2010
Hi afernandez137,

Very nice, thank you & well done !! :-)

Bob
alryalls 24 Mar, 2010
Hey afernandez137, thanks very much for your post. After following your instructions I made the mistake of linking my joomla menu item to the first child form, instead of the mother form. Got me for a couple of hours!

Thanks again mate, nice one

Al
platipalapi 05 Apr, 2010
afernandez137 solution does not work for me.
when i click on the "back" button, i get back to a empty form.
GreyHead 06 Apr, 2010
Hi platipalapi,

Sounds as if you may have missed this part

(you'll have to enable the 'Try to republish' in every form).


Bob
platipalapi 06 Apr, 2010
thanks for your reply 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)

:\
ahwoogamac 20 Apr, 2010
I made the mistake of hijacking somebody else's thread, since their question seemed to indicate that that they the solution to my problem. I didn't get a response (which I'm sure I deserved), so I'm asking it here... hoping that somebody might know the answer to my problem.

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?
GreyHead 20 Apr, 2010
Hi ahwoogamac,

[list]
  • Make sure that the table has columns with names matching all the inputs that you want to save.
  • Enable DB Connections on all the steps.
  • Pickup the cf_id (the record primary key) from Step 1 and add it as a hidden field in each of the following steps.
  • [/list]

    Bob
    ahwoogamac 20 Apr, 2010
    Okay, I had done everything, except the last item (Pickup the cf_id (the record primary key) from Step 1 and add it as a hidden field in each of the following steps) had a couple different ways people were doing it in the forums. What is the correct method to do this?
    GreyHead 20 Apr, 2010
    Hi ahwoogamac,

    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
    ahwoogamac 20 Apr, 2010
    Yeah, I tried that one before. When I insert into the Form HTML area of the second step (with the correct table name, I might add) and I get the following error:

    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
    GreyHead 20 Apr, 2010
    Hi ahwoogamac,

    Hmmm . . .
    Please try adding this line
    <?php
    require_once( JPATH_COMPONENT.DS.'libraries'.DS.'chronoform.php');
    $data = . . .

    Bob
    ahwoogamac 21 Apr, 2010
    When I added that code, I got this error:

    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?
    GreyHead 21 Apr, 2010
    Hi ahwoogamac,

    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
    ahwoogamac 21 Apr, 2010
    Thank you Bob. I went ahead and added that.

    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.
    GreyHead 25 Apr, 2010
    Hi ahwoogamac,

    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
    rowby 26 Apr, 2010
    HI

    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
    ahwoogamac 26 Apr, 2010
    I must have some setting wrong somewhere. I'll have to comb through everything and try again.
    eki 29 Apr, 2010
    Hi!

    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
    GreyHead 29 Apr, 2010
    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
    rowby 29 Apr, 2010
    Hi 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

    eki 30 Apr, 2010

    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
    GreyHead 08 May, 2010
    Hi eki,

    I think that ChronoForms puts the data in a $posted array so you'd need to set the values from there.

    Bob
    mbowerbank 10 May, 2010
    Hi, I've been trying to get the multipage plugin working as per this thread, I seem to have a strange error, is this chrono or the plugin or something else. When I go into the motherform i get a big bunch of code here is some of it, (see below) I have acajoom installed in the joomla installation although that works fine, so I was hoping for some good questions from anyone who knows. thanks.

    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() {
    GreyHead 11 May, 2010
    Hi mbowerbank,

    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
    jazzchaos 14 Jun, 2010
    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
    wlamarket 22 Jun, 2010

    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...
    GreyHead 23 Jun, 2010
    Hi Sean,

    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
    jazzchaos 24 Jun, 2010
    thanks! did the trick.

    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
    jazzchaos 25 Jun, 2010
    BTW....here is my code for unsetting an item in the posted array in a multi page form with the parent form named 'mom':

    
    unset($posted['field_name']);
    $session =& JFactory::getSession();
    $session->set('chrono_formpages_data_mom', $posted, md5('chrono'));
    
    chubert626 07 Jul, 2010
    I think I am setting things up properly but I create 4 child forms (published) and a mother form. I check mark the mother form and set the plugin to 4 forms and set the child form names. Now when I test the form, I go to the mother form link and I see the first page. After filling the form in I hit submit but instead of advancing to the next page, it gives me the first page again. Can someone help me out please. Thanks so much.

    Chris
    vavslovakia 08 Jul, 2010
    Good day,

    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
    GreyHead 10 Jul, 2010
    Hi vavslovakia,

    To get a single Email you need to use the Mother Form to send the email.

    Bob
    vavslovakia 12 Jul, 2010
    and where i need to put email template ?
    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 😟
    GreyHead 12 Jul, 2010
    Hi vavslovakia,

    Turn off the emails for all of the child forms.

    Build a single Email Template in the mother form.

    Bob
    kpelephant 13 Jul, 2010
    Oh my god this is so confusing.
    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.
    kandyztick 15 Jul, 2010
    I'm still trying to go through this whole thread. It's still kinda confusing but thanks for all the instructions.
    vavslovakia 15 Jul, 2010
    Ok, big problem with multi page and 3.1 RC5.5
    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
    GreyHead 15 Jul, 2010
    Hi vavslovakia,

    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
    vavslovakia 15 Jul, 2010
    Thank you, but still is there 2 questions
    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
    GreyHead 15 Jul, 2010
    Hi vavslovakia,

    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
    vavslovakia 22 Jul, 2010
    thank you very much, thats very good

    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
    judyksp 03 Sep, 2010
    Hi, where can I get to download this plugin?
    GreyHead 03 Sep, 2010
    Hi judyksp,

    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
    rdonato 05 Sep, 2010
    Is the multipage plugin supposed to supply the "next" and "back" buttons or do I have to provide that in the html. I have a 2 page form and the motherform link is working but no buttons. Also I've enabled captcha plug in on both mother form and formpage1 and nothing happens. I want to tackle the buttons first though.

    thanks!
    GreyHead 05 Sep, 2010
    Hi rdonato,

    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
    hhawkins25 08 Sep, 2010
    I am a newbie and I finally have my multi-page form (7) set-up and emailing. 😀

    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.
    GreyHead 09 Sep, 2010
    Hi hhawkins25,

    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
    hhawkins25 09 Sep, 2010
    When the use the back button or Previous section in my instance it appears blank.
    Is there something I need turn on for the fields to stay populated/or repopulate?

    Thanks
    mamdani 24 Sep, 2010
    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.
    GreyHead 25 Sep, 2010
    Hi mamdani ,

    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.
    DarksteelBlade 01 Oct, 2010
    hhawkins25

    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.
    ilanle 22 Oct, 2010
    Hey,

    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
    GreyHead 22 Oct, 2010
    Hi 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
    pragati 03 Dec, 2010
    Hi,
    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?
    GreyHead 03 Dec, 2010
    Hi Pragati ,

    Have you enabled the plug-in on the Mother Form Plug-ins tab?

    Bob
    pragati 03 Dec, 2010
    Hi Bob,
    Yes, the plugin is enabled.
    The email is not enabled in any of the forms.
    GreyHead 03 Dec, 2010
    Hi Pragati,

    Please post a link to the form so we can take a quick look.

    Bob
    pragati 03 Dec, 2010
    GreyHead 03 Dec, 2010
    Hi Pragati,

    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
    pragati 04 Dec, 2010
    Hi 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?
    GreyHead 05 Dec, 2010
    Hi Pragati ,

    By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

    Bob
    szabob 18 Dec, 2010
    An easy question for the experts:

    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
    szabob 20 Dec, 2010
    Could anyone help please? It should not be difficult but I am not experienced in php/mysql.

    I rephrase the question: How could I put the name of the actual child form into one of the hidden fields?

    Thanks

    Bob
    GreyHead 21 Dec, 2010
    Hi 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
    szabob 21 Dec, 2010
    Hi GreyHead,

    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
    GreyHead 22 Dec, 2010
    Hi Bob,

    The code looks OK to me - what is the URL of the page when the form is loaded?

    Bob
    szabob 01 Jan, 2011
    Thanks 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

    prince71 24 Mar, 2011
    Hi,
    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
    GreyHead 25 Mar, 2011
    Hi price71,

    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
    prince71 29 Mar, 2011

    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
    gatsu 04 Apr, 2011
    We have a lengthy 3 step application process on our site. When each step is manually accessed by their direct URL there is no problem with the form. When we access it by the mother form the first step shows up as normal, but upon submit nothing changes. The first step simply reloads.

    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 ( ) 
    GreyHead 05 Apr, 2011
    Hi Gatsu,

    I can’t see any obvious reason for this. The form itself looks good. I'm trying to think what might cause this:[list]
  • Session info not being saved - seems unlikely

  • A redirect or onsubmit url on the mother form of the step 1 form

  • Something else . . .
  • [/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
    gatsu 06 Apr, 2011
    Did you get our email?
    GreyHead 06 Apr, 2011
    Hi Gatsu,

    Yes but it's 10pm here so I won’t be looking until the morning :-(

    Off to watch some TV.

    Bob
    gatsu 06 Apr, 2011

    Hi Gatsu,

    Yes but it's 10pm here so I won’t be looking until the morning :-(

    Off to watch some TV.

    Bob



    I can completely understand, Cheers.
    This topic is locked and no more replies can be posted.