Hello,
ChronoForms_V3.1_RC5.5
There's Form Code, onSubmit Events Code, before sending email:
I want replace empty values after submit form. Without this code emails sends OK.
When I run the form, I get error
Fatal error: Call to undefined method CFCustomCode::showFormErrors() in public_html/components/com_chronocontact/libraries/chronoform.php on line 427
ChronoForms_V3.1_RC5.5
There's Form Code, onSubmit Events Code, before sending email:
I want replace empty values after submit form. Without this code emails sends OK.
<?php
$MyForm = $this->getInstance('Form_Rejestracyjny');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
for($i=0;$i<count($MyFormEmails->emails);$i++){
$MyFormEmails->emails[$i]->template = str_replace("{check2}", "", $MyFormEmails->emails[$i]->template);
$MyFormEmails->emails[$i]->template = str_replace("{check3}", "", $MyFormEmails->emails[$i]->template);
$MyFormEmails->emails[$i]->template = str_replace("{check4}", "", $MyFormEmails->emails[$i]->template);
$MyFormEmails->emails[$i]->template = str_replace("{check5}", "", $MyFormEmails->emails[$i]->template);
$MyFormEmails->emails[$i]->template = str_replace("{check6}", "", $MyFormEmails->emails[$i]->template);
$MyFormEmails->emails[$i]->template = str_replace("{check7}", "", $MyFormEmails->emails[$i]->template);
$MyFormEmails->emails[$i]->template = str_replace("{check8}", "", $MyFormEmails->emails[$i]->template);
}
?>
When I run the form, I get error
Fatal error: Call to undefined method CFCustomCode::showFormErrors() in public_html/components/com_chronocontact/libraries/chronoform.php on line 427
Hi,
Please change the definition of MyForm as follows:
/Fredrik
Please change the definition of MyForm as follows:
<?php
/* This will not work, $this refers to the CFCustomCode class, not the CFChronoForm class */
$MyForm =& $this->getInstance('Form_Rejestrancyjny');
/* Make sure we use the proper method from the proper class instead: */
$MyForm =& CFChronoForm::getInstance('Form_Rejestrancyjny');
...
/Fredrik
Hi Fredrik & lighthunter.
It's worth checking with a print_r debug statement if $MyForm is already defined and available, in my experiments it quite often is.
Bob
It's worth checking with a print_r debug statement if $MyForm is already defined and available, in my experiments it quite often is.
Bob
Hi,
Please change the definition of MyForm as follows:
/Fredrik
It's works. Thanx a lot
This topic is locked and no more replies can be posted.