0

I followed exactly the typo3 formhandler "how-to-set-up-a-simple-form". The standaard form works, but when I add the validation part the form post will give a white screen. I used the typoscript below. What causes the from to go to a white screen after the validation?

plugin.Tx_Formhandler.settings {   

  validators.1.class = Validator_Default
  validators.1.disabled = 0
  validators.1.config.fieldConf {
    message.errorCheck.1 = required
    message.errorCheck.2 = minLength
    message.errorCheck.2.value = 5

    sender_name.errorCheck.1 = required

    sender_email.errorCheck.1 = required
    sender_email.errorCheck.2 = email
  }

  addErrorAnchors = 1
  singleErrorTemplate {
    totalWrap = |
    singleWrap = <span style="color: red;">|</span>
  }
  errorListTemplate {
    totalWrap = <div style="color: red;">Es sind folgende Fehler aufgetreten: <ul>|</ul></div>
    singleWrap = <li>|</li>
  }

  debug = 0    
  langFile = fileadmin/templates/sandraverdijck/lang/lang-contactform.xml
  templateFile = fileadmin/templates/sandraverdijck/html/contactform.html  
  formValuesPrefix = formhandler    
  finishers {     
    1 {       
      class = Tx_Formhandler_Finisher_Mail     
    }     
    2 {       
      class = Tx_Formhandler_Finisher_SubmittedOK       
      config.returns = 1     
    }   
  } 
}
Tom
  • 1,547
  • 7
  • 27
  • 50
  • Set `displayErrors`in Install Tool to '1' to see error messages on screen. What is the error message? – Sven R. Jul 12 '14 at 07:51
  • Hello sreuter, thanks for the replay. I'm new with typo3, where can I found the "install tool" so I can set the variable "displayErrors" to 1? When I click on the Fromhandler in the left colum I also get the error: 'Reason: File "index.php" was not found (2)!' – Tom Jul 12 '14 at 08:33
  • You can find the Install Tool in menu block 'Admin Tools' -> 'Install'. There is a menu item called 'All Configuration' where you can search for the item 'displayErrors' and set it to '1'. After saving TYPO3 shows you all errors occurring. For production use you should set this value back to '0' or '2'. – Sven R. Jul 12 '14 at 09:20
  • You can also look into the servers error log, since a white screen (= empty sourcecode) almost always indicates a PHP error. It would also be nice to know which versions of TYPO3 and formhandler you use. – Jost Jul 12 '14 at 09:27
  • I'm using typo3 6.2.4 and the news extension has version 3.0.1. I'm managed to display the errors and i'm getting the following error: 'Fatal error: Call to undefined function mb_strlen() in /home/sandev/public_html/typo3conf/ext/formhandler/Classes/Validator/ErrorChecks/Tx_Formhandler_ErrorCheck_MinLength.php on line 35' – Tom Jul 12 '14 at 09:40
  • So you have to enable `mbstring` extension, see i.e. here: http://stackoverflow.com/questions/6419102/fatal-error-call-to-undefined-function-mb-strlen – biesior Jul 12 '14 at 12:12
  • also set 'debug=1' above – Urs Jul 12 '14 at 19:34
  • Thanks it is working now with enabling the mb_strlen. Regarding the tip to enable 'debug=1' was not working. When I enable that the page stops redering half way the form – Tom Jul 15 '14 at 20:50

1 Answers1

0

So in this case you find your solution here. Summary: mb_strlen is not enabled by default. You have to do that.

Community
  • 1
  • 1
Sven R.
  • 1,049
  • 17
  • 24