I'm following this example tutorial
project code: http://akrabat.com/wp-content/uploads/zf-tutorial-layoutform.zip
tutorial: http://akrabat.com/zend-framework/a-form-in-your-layout/
The project code runs as expected, until I add a hash element to the form. All I do is add this code in the form under application/forms/Signup.php
$hash = new Zend_Form_Element_Hash('hash');
$hash->setSalt('mysalt');
$this->addElement($hash);
This extra bit of code throws everything off. When I submit the form now, it gives me the error that the 2 tokens don't match.
Some troubleshooting:
That's the extent of troubleshooting I could think of at my level of expertise with Zend. So thought it's time to ask the big brains. I'm hoping someone can figure it out.
It works for you even after you've added the hash element to the form? If so, could you please upload your project and post as a separate answer.
All I did was add the code you posted and it worked fine. Where are you using this code? It sounds like something to do with your environment?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With