0

I am trying to place a non form related button into the view for a registration button to direct people to a controller action but i continue to get error500 internal error. Any ideas what i am doing wrong here?

<?php 
echo $this->Form->create('User');
echo $this->Session->flash();
echo $this->Form->input('username', array('label' => false, 'div' => false, 'class' => 'w-icon validate[required]'));
echo $this->Form->input('password', array('label' => false, 'div' => false, 'class' => 'w-icon validate[required]'));
echo $form->button('Register', array('type' => 'button', 'class' => 'button red tiny'));
echo $this->Form->submit('Login', array('class' => 'button blue tiny'));
echo $this->Form->end();
?>

1 Answer 1

2

$form->button is CakePHP 1.2 syntax, $this->Form is 1.3 onwards.

Sign up to request clarification or add additional context in comments.

3 Comments

thank you for this! how would i make the button point to a controller/action instead of being a submit button?
Buttons do not point to anything, they submit forms. That is how HTML works. You can use a link to go to something else. $this->Html->link(...)
final solution was echo $this->Form->button('Register', array('onclick' => "location.href='/register'", 'class' => 'button red tiny'));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.