Forums

error message on custom server side validation

swd 24 May, 2013
Hi everyone

My guess is I'm missing out on a code glitch, therefore I'm posting it in the "Questions" sections rather than under bugs.

I have created a rather large order form for a delivery service and have used my tried and true customer server validation script. However, if i check a checkbox (which is not being validated) and the server validation throws back an error somewhere else, I get the following error message printed at the top:

Warning: strpos() expects parameter 1 to be string, array given in /data/web/e13724/html/vkurier/components/com_chronoforms/libraries/includes/data_republish.php on line 101

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /data/web/e13724/html/vkurier/components/com_chronoforms/libraries/includes/data_republish.php on line 104



It's a multi page form and here's what my custom server validation code for page 1 looks like:

<?php
$error_count = 0;
if ( $form->data['datepicker_lieferung'] == "" ) {
  $form->validation_errors['datepicker_lieferung'] = 'Bitte wählen Sie einen Liefertermin.';
  $error_count++;
}
if ( $form->data['liefergebiet'] == "" ) {
  $form->validation_errors['liefergebiet'] = 'Sie müssen das Liefergebiet zur Kenntnis nehmen und bestätigen.';
  $error_count++;
}

if ( $error_count ) {
  return false;
}
?>


anybody see where I'm missing something? Maybe in the JS Code?
I'm running Joomla 3.1 and the latest Chronoforms v4

cheerio
Michael

PS: Subscription will of course be applied once the form is resting on its "final destination" url🙂
GreyHead 24 May, 2013
Hi Michael,

It looks as though the code could do with a little polishing there. There is no error though, just a PHP Notice. On a live site you should set site Error Reporting to System Default or None which will normally prevent these from being displayed.

Bob
This topic is locked and no more replies can be posted.