I'm trying to create a form with multiple file upload fields with only 1 of them being mandatory and the rest optional, what is happening is that ChronoForms shows empty error message when the optional file upload field(s) aren't used.
Is there anyway to accomplish this?
Here is my form(if necessary):
<++-++-++id++-++-++>4<endendend><++-++-++name++-++-++>UploadCase<endendend><++-++-++html++-++-++><div class="form_item">
<div class="form_element cf_heading">
<h1 class="cf_text">Upload Case</h1>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_fileupload">
<label class="cf_label" style="width: 150px;">Video 1</label>
<input class="cf_fileinput cf_inputbox required" title="" size="20" id="file_1" name="file_1" type="file" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textarea">
<label class="cf_label" style="width: 150px;">Video 1 Description</label>
<textarea class="cf_inputbox required" 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_fileupload">
<label class="cf_label" style="width: 150px;">Video 2</label>
<input class="cf_fileinput cf_inputbox" title="" size="20" id="file_3" name="file_3" type="file" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textarea">
<label class="cf_label" style="width: 150px;">Video 2 Description</label>
<textarea class="cf_inputbox" rows="3" id="text_4" title="" cols="30" name="text_4"></textarea>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_fileupload">
<label class="cf_label" style="width: 150px;">Video 3</label>
<input class="cf_fileinput cf_inputbox" title="" size="20" id="file_5" name="file_5" type="file" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textarea">
<label class="cf_label" style="width: 150px;">Video 3 Description</label>
<textarea class="cf_inputbox" rows="3" id="text_6" title="" cols="30" name="text_6"></textarea>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="button_7" type="submit" />
</div>
<div class="cfclear"> </div>
</div>
<endendend><++-++-++scriptcode++-++-++><endendend><++-++-++stylecode++-++-++><endendend><++-++-++redirecturl++-++-++><endendend><++-++-++emailresults++-++-++>0<endendend><++-++-++fieldsnames++-++-++>file_1,file_3,file_5,text_2,text_4,text_6<endendend><++-++-++fieldstypes++-++-++>file,file,file,textarea,textarea,textarea<endendend><++-++-++onsubmitcode++-++-++><p>Thanks for submitting your case, it will be reviewed and added.</p><endendend><++-++-++onsubmitcodeb4++-++-++><endendend><++-++-++server_validation++-++-++><endendend><++-++-++attformtag++-++-++><endendend><++-++-++submiturl++-++-++><endendend><++-++-++emailtemplate++-++-++><endendend><++-++-++useremailtemplate++-++-++><endendend><++-++-++paramsall++-++-++>formmethod=post
LoadFiles=Yes
submissions_limit=
submissions_limit_error=Sorry but you can not submit the form again very soon like this!
handlepostedarrays=Yes
debug=1
checkToken=1
mysql_type=1
enmambots=No
captcha_dataload=0
captcha_dataload_skip=
useCurrent=
datefieldformat=d/m/Y
datefieldsnames=
datefieldextras=classes: ['dashboard']
dbconnection=Yes
savedataorder=after_email
dvfields=
dvrecord=Record #n
uploads=Yes
uploadfields=file_1:txt|*{10240-0},file_3:{10240-0},file_5:{10240-0}
uploadpath=/home/ieseg0/public_html/cathnightmares/components/com_chronocontact/uploads/UploadCase/
filename_format=$filename = date('YmdHis').'_'.$chronofile['name'];
upload_exceedslimit=Sorry, Your uploaded file size exceeds the allowed limit.
upload_lesslimit=Sorry, Your uploaded file size is less than the allowed limit
upload_notallowed=Sorry, Your uploaded file type is not allowed
imagever=No
imtype=0
imgver_error_msg=You have entered an incorrect verification code at the bottom of the form.
validate=No
validatetype=mootools
validate_onlyOnBlur=1
validate_wait=
validate_onlyOnSubmit=0
validation_type=default
val_required=
val_validate_number=
val_validate_digits=
val_validate_alpha=
val_validate_alphanum=
val_validate_date=
val_validate_email=
val_validate_url=
val_validate_date_au=
val_validate_currency_dollar=
val_validate_selection=
val_validate_one_required=
val_validate_confirmation=
servervalidate=No
autogenerated_order=3
onsubmitcode_order=2
plugins_order=1
plugins=
mplugins_order=
tablenames=jos_chronoforms_UploadCase<endendend><++-++-++titlesall++-++-++><endendend><++-++-++extravalrules++-++-++><endendend><++-++-++dbclasses++-++-++><?php
if (!class_exists('Tablechronoforms_UploadCase')) {
class Tablechronoforms_UploadCase extends JTable {
var $cf_id = null;
var $uid = null;
var $recordtime = null;
var $ipaddress = null;
var $cf_user_id = null;
var $file_1 = null;
var $file_3 = null;
var $file_5 = null;
var $text_2 = null;
var $text_4 = null;
var $text_6 = null;
function __construct( &$database ) {
parent::__construct( 'jos_chronoforms_UploadCase', 'cf_id', $database );
}
}
}
?>
<endendend><++-++-++autogenerated++-++-++><?php
$MyForm =& CFChronoForm::getInstance("UploadCase");
if($MyForm->formparams("dbconnection") == "Yes"){
$user = JFactory::getUser();
$row =& JTable::getInstance("chronoforms_UploadCase", "Table");
srand((double)microtime()*10000);
$inum = "I" . substr(base64_encode(md5(rand())), 0, 16).md5(uniqid(mt_rand(), true));
JRequest::setVar( "recordtime", JRequest::getVar( "recordtime", date("Y-m-d")." - ".date("H:i:s"), "post", "string", "" ));
JRequest::setVar( "ipaddress", JRequest::getVar( "ipaddress", $_SERVER["REMOTE_ADDR"], "post", "string", "" ));
JRequest::setVar( "uid", JRequest::getVar( "uid", $inum, "post", "string", "" ));
JRequest::setVar( "cf_user_id", JRequest::getVar( "cf_user_id", $user->id, "post", "int", "" ));
$post = JRequest::get( "post" , JREQUEST_ALLOWRAW );
if (!$row->bind( $post )) {
JError::raiseWarning(100, $row->getError());
}
if (!$row->store()) {
JError::raiseWarning(100, $row->getError());
}
$MyForm->tablerow["jos_chronoforms_UploadCase"] = $row;
}
?>
<endendend><++-++-++chronocode++-++-++>[type="cf_heading"CHRONO_CONSTANT_EOL{CHRONO_CONSTANT_EOLclass = cf_textCHRONO_CONSTANT_EOLhidelabel = 0CHRONO_CONSTANT_EOLtag = h1CHRONO_CONSTANT_EOLlabelwidth = 0CHRONO_CONSTANT_EOLlabeltext = Upload CaseCHRONO_CONSTANT_EOLtooltiptext = CHRONO_CONSTANT_EOL}]CHRONO_CONSTANT_EOL[type="cf_fileupload"CHRONO_CONSTANT_EOL{CHRONO_CONSTANT_EOLid = file_1CHRONO_CONSTANT_EOLname = file_1CHRONO_CONSTANT_EOLclass = cf_inputbox requiredCHRONO_CONSTANT_EOLsize = 20CHRONO_CONSTANT_EOLtitle = CHRONO_CONSTANT_EOLhidelabel = 0CHRONO_CONSTANT_EOLlabelwidth = 150pxCHRONO_CONSTANT_EOLlabeltext = Video 1CHRONO_CONSTANT_EOLtooltiptext = CHRONO_CONSTANT_EOLdata = file_1:txt|*{10240-0}CHRONO_CONSTANT_EOLslabel = CHRONO_CONSTANT_EOL}]CHRONO_CONSTANT_EOL[type="cf_textarea"CHRONO_CONSTANT_EOL{CHRONO_CONSTANT_EOLid = text_2CHRONO_CONSTANT_EOLname = text_2CHRONO_CONSTANT_EOLclass = cf_inputbox requiredCHRONO_CONSTANT_EOLrows = 3CHRONO_CONSTANT_EOLcols = 30CHRONO_CONSTANT_EOLtitle = CHRONO_CONSTANT_EOLhidelabel = 0CHRONO_CONSTANT_EOLlabelwidth = 150pxCHRONO_CONSTANT_EOLlabeltext = Video 1 DescriptionCHRONO_CONSTANT_EOLtooltiptext = CHRONO_CONSTANT_EOLslabel = CHRONO_CONSTANT_EOL}]CHRONO_CONSTANT_EOL[type="cf_fileupload"CHRONO_CONSTANT_EOL{CHRONO_CONSTANT_EOLid = file_3CHRONO_CONSTANT_EOLname = file_3CHRONO_CONSTANT_EOLclass = cf_inputboxCHRONO_CONSTANT_EOLsize = 20CHRONO_CONSTANT_EOLtitle = CHRONO_CONSTANT_EOLhidelabel = 0CHRONO_CONSTANT_EOLlabelwidth = 150pxCHRONO_CONSTANT_EOLlabeltext = Video 2CHRONO_CONSTANT_EOLtooltiptext = CHRONO_CONSTANT_EOLdata = file_3:{10240-0}CHRONO_CONSTANT_EOLslabel = CHRONO_CONSTANT_EOL}]CHRONO_CONSTANT_EOL[type="cf_textarea"CHRONO_CONSTANT_EOL{CHRONO_CONSTANT_EOLid = text_4CHRONO_CONSTANT_EOLname = text_4CHRONO_CONSTANT_EOLclass = cf_inputboxCHRONO_CONSTANT_EOLrows = 3CHRONO_CONSTANT_EOLcols = 30CHRONO_CONSTANT_EOLtitle = CHRONO_CONSTANT_EOLhidelabel = 0CHRONO_CONSTANT_EOLlabelwidth = 150pxCHRONO_CONSTANT_EOLlabeltext = Video 2 DescriptionCHRONO_CONSTANT_EOLtooltiptext = CHRONO_CONSTANT_EOLslabel = CHRONO_CONSTANT_EOL}]CHRONO_CONSTANT_EOL[type="cf_fileupload"CHRONO_CONSTANT_EOL{CHRONO_CONSTANT_EOLid = file_5CHRONO_CONSTANT_EOLname = file_5CHRONO_CONSTANT_EOLclass = cf_inputboxCHRONO_CONSTANT_EOLsize = 20CHRONO_CONSTANT_EOLtitle = CHRONO_CONSTANT_EOLhidelabel = 0CHRONO_CONSTANT_EOLlabelwidth = 150pxCHRONO_CONSTANT_EOLlabeltext = Video 3CHRONO_CONSTANT_EOLtooltiptext = CHRONO_CONSTANT_EOLdata = file_5:{10240-0}CHRONO_CONSTANT_EOLslabel = CHRONO_CONSTANT_EOL}]CHRONO_CONSTANT_EOL[type="cf_textarea"CHRONO_CONSTANT_EOL{CHRONO_CONSTANT_EOLid = text_6CHRONO_CONSTANT_EOLname = text_6CHRONO_CONSTANT_EOLclass = cf_inputboxCHRONO_CONSTANT_EOLrows = 3CHRONO_CONSTANT_EOLcols = 30CHRONO_CONSTANT_EOLtitle = CHRONO_CONSTANT_EOLhidelabel = 0CHRONO_CONSTANT_EOLlabelwidth = 150pxCHRONO_CONSTANT_EOLlabeltext = Video 3 DescriptionCHRONO_CONSTANT_EOLtooltiptext = CHRONO_CONSTANT_EOLslabel = CHRONO_CONSTANT_EOL}]CHRONO_CONSTANT_EOL[type="cf_button"CHRONO_CONSTANT_EOL{CHRONO_CONSTANT_EOLvalue = SubmitCHRONO_CONSTANT_EOLname = button_7CHRONO_CONSTANT_EOLtooltiptext = CHRONO_CONSTANT_EOLreset = 0CHRONO_CONSTANT_EOLhidelabel = 0CHRONO_CONSTANT_EOLlabelwidth = 0CHRONO_CONSTANT_EOL}]CHRONO_CONSTANT_EOL<endendend><++-++-++theme++-++-++>default<endendend><++-++-++published++-++-++>1<endendend><++-++-++extra1++-++-++><endendend><++-++-++extra2++-++-++><endendend><++-++-++extra3++-++-++><endendend><++-++-++extra4++-++-++><endendend><++-++-++extra5++-++-++><endendend>
{cfbak_start_emails}
{cfbak_end_emails}