I'm updating a form in my zend project it's pretty basic. After updating the form to use a <button type="submit"> tag it's not posting the form.
Does not work
<button type="submit" name="Save">Continue</button>
Works <input type="submit" name="Save" value="Next">
Part of the code in the controller which throws the error is below, why is $value = trim($value); showing up empty when I post the form? All my fields and form action is correct I've tested everything and it's come down to the submit button type being the problem. Thanks
$userSess = new Zend_Session_Namespace('Default');
if (!$this->getRequest()->isPost()) {
$this->_helper->redirector('index','welcome');
}
$postData = $this->_request->getPost();
//validating form data, if empty data comes, redirect with err msg
foreach($postData as $key => $value) {
$value = trim($value);
if($value == "") //if empty field submitted, redirect back with invalid msg
$this->_helper->redirector('index','welcome',null,array('err'=>'Please Fill in all details'));
}