email validation

Permalink
Built form with certain items required and catcha, easy. Cannot get email input to validate. Type one character and it's sent, no error on missing '@'or '.' . Found the string that I thought would throw the error, but it does not implement. do I need to do something else to get it to work?

Tried the form patches they don't seem to work either.

So is it me or something else?

Please help, spent most the weekend trying to get this to work........

Steevb
 
Tony replied on at Permalink Reply
Tony
the form block currently does not have email validation. you may want to read this thread:

http://www.concrete5.org/index.php?cID=25525...

and if you need email validation, then for now a custom coded form using a single page is your best bet.
kino replied on at Permalink Reply
kino
Steevb replied on at Permalink Reply
Steevb
I have now produced my own through 'Flash and PHP'

Sorry kino, did not work for me. Ajax = errors


Thank you anyway.
designbordello replied on at Permalink Reply
designbordello
Try this...

Create the a controller.php in /BLOCKS/FORM/ and copy the controller.php from /CONCRETE/BLOCKS/FORM/ to that.

About line 218, replace:

//checked required fields
      foreach($rows as $row){
         if( intval($row['required'])==1 ){
            $notCompleted=0;
            if($row['inputType']=='checkboxlist'){
               $answerFound=0;
               foreach($_POST as $key=>$val){
                  if( strstr($key,'Question'.$row['msqID'].'_') && strlen($val) ){
                     $answerFound=1;
                  } 
               }
               if(!$answerFound) $notCompleted=1;
            }elseif($row['inputType']=='fileupload'){      
               if( !isset($_FILES['Question'.$row['msqID']]) || !is_uploaded_file($_FILES['Question'.$row['msqID']]['tmp_name']) )               
                  $notCompleted=1;


with

//checked required fields
      $email_error=0;
      $errors['CompleteRequired'] = "<br>";
      foreach($rows as $row){
         if( intval($row['required'])==1 ){
            $notCompleted=0;
            if($row['inputType']=='checkboxlist'){
               $answerFound=0;
               foreach($_POST as $key=>$val){
                  if( strstr($key,'Question'.$row['msqID'].'_') && strlen($val) ){
                     $answerFound=1;
                  } 
               }
               if(!$answerFound) $notCompleted=1;
            }elseif($row['inputType']=='fileupload'){


I've had success with this on my AJAX form.