Forums

How to dynamically disable the email if some field is empty

anindyasundar 01 Dec, 2009
I have purchased ChronoForm license.

I have a problem regarding chronoform. Please click http://www.portraitnpainting.com/hand-art/oil-portrait At bottom of the page, a from. No fields are mandatory. If you click on the button 'Proceed to step 2' without fill in any field you will go to next page. And an empty email will go to administrator.

I want that, if any visitor does not fill in any particular field/fields (here Upload file), no email will go. But the visitor will go to next page.

How it is possible?
Max_admin 01 Dec, 2009
Hi Anindya,


<?php
$MyForm =& CFChronoForm::getInstance('form name here'); // please add the real form name
if(!trim(JRequest::getVar('upload_field_name'))){ // add real file field name
$MyForm->setFormData('emailresults', false);
}
?>


Please replace the necessary data and add this code in the on submit BEFORE email code box!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
anindyasundar 02 Dec, 2009
Thanks. But it does not work. I replaced the necessary data and add this code here:

Clicked on the form name, then under form code tab in the On Submit code - before sending email: box.
This topic is locked and no more replies can be posted.