Forums

Include forms in my own component

vjmazcu 14 May, 2009
I want to include a chronoform in a tab that shows in my own component, but I'dont know how to do it.

Is there a function call to include a chronoform?
GreyHead 14 May, 2009
Hi vizmazcu,

There's a ChronoForms PlugIn/Mambot that you can call using the standard Joomla plugin code, that's the best way to go.

Bob
Max_admin 14 May, 2009
Hi vizmazcu,

2 ways:

#1- the way Bob said, you call the mambot and enable mambots to run at your component!
#2- assure that Chronoforms is installed and then at your component use this code:

require_once( JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'libraries'.DS.'chronoform.php');
$formname = 'some form name';//if left empty then it will be grabbed from the URL
$MyForm =& CFChronoForm::getInstance($formname);
$MyForm->showForm($formname);


Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vjmazcu 14 May, 2009
I have tried two modes, and it is produce next error:

Warning: require_once(/var/www/corporativa/components/com_chronocontact/libraries/chronoform.php) [function.require-once]: failed to open stream: No such file or directory in

Because I haven't the direcory "components/com_chronocontact/libraries/".

I have installed de version "3.0 STABLE".

Thanks
GreyHead 14 May, 2009
Hi vjmazcu,

Please uninstall 3.0 Stable nad re-install the latest version from the downloads area here. The current ChronoForms Plugins and Modules will not work with the old version of ChronoForms.

Bob

PS Please make backup copies of your forms and take a backup of any form data you have in your database before you uninstall.
vjmazcu 14 May, 2009
Thanks Bob,

Do you know how to update chronoforms without loosing previous created forms?

Thanks
GreyHead 14 May, 2009
Hi vjmazcu,

Use the Form Backup icon in the Forms Manager toolbar to take backup copies of each of your forms.

Use PHP MyAdmin to backup all the chrono. . . database tables.

Unistall the ChronoForms Extension. (You need to do this with 3.0 stabel but not with the > 4.1 releases)

Install the current Chronofoems release RC 5.0 at the moment

Clear your browser cache to get rid onf any of the scripts left from the previous version.

Restore your forms and check they work OK, you may need to open and svae them one to clear any errrors.

Restore any missing database tables - you may need to add a new column to sum if you see an error.

Check the versions of the ChronoForms Module & Plugin/Mambot and, if necessary, update these to the latest release by uninstalling and re-installing.

Bob
vjmazcu 15 May, 2009
Thanks bob,

I just have updated chronoforms, but doesn't work.

I have used first mode in my component. Example: "{chronocontact}Peticion_Informacion{/chronocontact}" and doesn't work.

And I have used de second mode. Example: "require_once(JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'libraries'.DS.'chronoform.php');
$formname = 'Peticion_Informacion;
$MyForm =& CFChronoForm::getInstance($formname);
$MyForm->showForm($formname);"

and it is produce an execution error in the showForm

Later, I proved it firts mode in an article, and in a article work correctly.

Do you think that the error is in head page, because in my component don't charge the same script that article head?

I don't know how to solve it!

Thanks
GreyHead 15 May, 2009
Hi vjmazcu,

For this to work Your component needs to include the code to support Joomla Plugins. You can find the code for this probably on the Joomla Dev documentation site.

Bob
Max_admin 18 May, 2009
Hi,

I have been using this code recently and I found that 3 files should be included to prevent any errors from happening!


require_once( JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'libraries'.DS.'chronoform.php');
require_once( JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'libraries'.DS.'plugins.php');
require_once( JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'chronocontact.html.php');


Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vjmazcu 18 May, 2009
Thanks Bob

I'will look for it.
vjmazcu 18 May, 2009
I don't founded this information in joomla development document. But i saw in the source code the next code:

"<script src="components/com_chronocontact/js/livevalidation_standalone.js" type="text/javascript"></script>"

And two calls to chrono css.

I have added thin in my code and the navigator show this error "Fatal error: Class 'CFPlugins' not found in /var/www/corporativa/components/com_chronocontact/libraries/chronoform.php on line 130"

Do yo know what is the problem?

Thanks
GreyHead 18 May, 2009
Hi vjmazcu,

I think you will fix this if you include the files Max listed in his last post here.

Bob
vjmazcu 18 May, 2009
Thanks you very much.

I just inserted the chronoform in my component.

Is there any function to assign value to form field?

I have probed with
$MyForm->setFormData('producto','nombre producto');
$MyForm->setFormParam('producto','nombre producto');

producto is input type="text" id="producto" name="producto"

but don work

Thanks
Max_admin 19 May, 2009
Hi vjmazcu,

you mean to load the form fields with some data onShow event ? you may need to change this line :
$MyForm->showForm($formname);

to
$MyForm->showForm($formname, $data);


the $data variable should be an array with the any number of elements, the element key should be the field name and the value should be the value, then you need to enable the republish setting in your form Anti spam tab!

$data = array('producto' => 'nombre producto');


Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vjmazcu 19 May, 2009
Thank you very much

Without your help I couldn't do it.

Thanks
Max_admin 20 May, 2009
No problems, If you faced any problems then let me know, if you have any suggestions then let me know too!🙂

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vjmazcu 20 May, 2009
Hello Max and Bob,

The showForm($forname, $data_field) call produces an javascript error in IE7, and don't work very well. Do not insert data in field.

In mozilla firefox woks very well.

Do you know why?

Thanks
GreyHead 20 May, 2009
Hi vjmazcu,

Most liekly because there is something else on the page that interferes with it. Impossible to tell without seeing the page (and if it's IE maybe not then either).

Bob
Max_admin 21 May, 2009
Hi vjmazcu,

Either as Bob said you have some conflict in JS in your page Or maybe $data_field has some wrong data which breaks the JS code, what does the array have ? use print_r to show me the contents of this array!

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vjmazcu 21 May, 2009
Thank you Max and Bob. The error is solved. It was an error in my component, because I two calls to mootools.js, an firefox works well, but IE7 was failing.

Thank you very much
This topic is locked and no more replies can be posted.