Re: form with reset and submit button

2009-07-17 Thread John Andersen
For the solution to do the clearing in the controller! Change the buttons to: echo $form-submit('Clear', array('name'='clear')); echo $form-submit('Save Post', array('name'='save')); In the controller, check for which button was used: if (!empty($this-data)) { ... if (

Re: form with reset and submit button

2009-07-17 Thread Carlos Lavin
Or you could do it with javascript... sending a server request(+ the framework's overhead) just to empty your fields is plain lazy programming 2009/7/17 John Andersen j.andersen...@gmail.com For the solution to do the clearing in the controller! Change the buttons to: echo

form with reset and submit button

2009-07-16 Thread Dhileepen Chakravarthy
Hi Everybody, I want to know how to show the form with reset or clear and submit button. reset to clear all form values , submit to submit the form.how do i do in cakephp, i can able to show the buttons like !-- File: /app/views/posts/add.ctp -- h1Add Post/h1 ?php echo $form-create('Post');

Re: form with reset and submit button

2009-07-16 Thread Dhileepen Chakravarthy
Please anyone gave me a solution --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to

Re: form with reset and submit button

2009-07-16 Thread rchavik
Trying moving your $form-button('Reset', ) to before $form-submit ('Save Post'); On Jul 17, 11:57 am, Dhileepen Chakravarthy dhileepen.cake...@gmail.com wrote: Please anyone gave me a solution --~--~-~--~~~---~--~~ You received this message because you

Re: form with reset and submit button

2009-07-16 Thread rchavik
Upon rereading your snippet, I think your code should've worked. I'm not sure what's going on here. On Jul 16, 3:36 pm, Dhileepen Chakravarthy dhileepen.cake...@gmail.com wrote: Hi Everybody, I want to know how to show the form with reset or clear and submit button. reset to clear all form

Re: form with reset and submit button

2009-07-16 Thread Amjad Farooq
uses in reset action $this-data['Post']['body'] = ''; $this-data['Post']['title'] = ''; hope it will work On Thu, Jul 16, 2009 at 2:36 PM, Dhileepen Chakravarthy dhileepen.cake...@gmail.com wrote: Hi Everybody, I want to know how to show the form with reset or clear and submit

Re: form with reset and submit button

2009-07-16 Thread John Andersen
A reset button will only return the form to the state it had upon showing the page with the form! Reset will not clear the form if the form already contains values! If you want to clear the form, use javascript or turn the reset/clear button into at submit button and handle the clearing in the

Re: form with reset and submit button

2009-07-16 Thread Dhileepen Chakravarthy
Thanks all !-- File: /app/views/posts/add.ctp -- h1Add Post/h1 ?php echo $form-create('Post'); echo $form-input('title'); echo $form-input('body', array('rows' = '3')); echo $form-button('Reset', array('type'='reset'), action=); echo $form-submit('Save Post'); echo $form-end(); ? //controller