Re: Add input field with jquery
Hey Luke i have a similar problem. can u share the solution or perhaps the code also. the basic way how about to get it going --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Add input field with jquery
Hi brian, excellent, thank you for your help. I got it to work. It is slightly different but your answer got me on the right route. Thank you again. Luke --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Add input field with jquery
This is just off the top of my head: function foo() { if (!empty($this->data) { $this->checkDynamicFields(); //... } //... } function checkDynamicFields() { $fields = array(); /* Go through $this->data looking for whatever dynamic fields * might be there. If found add its name & value to array. */ foreach($this->data['YOUR_MODEL'] as $key => $val) { if (IS_A_DYNAMIC_FIELD) { $fields[$key] = $val; } } $this->set('dynamic_fields', $fields); } in the view: if (isset($dynamic_fields) && isset($dynamic_fields['something'])) { // create 'something' input On Tue, Aug 18, 2009 at 12:01 PM, Luke wrote: > > Hi, > > I am having a form, where I want the User to be able to dynamically > add input fields. I have found some jquery script to achieve this. > Everything works fine, besides when I have a validation error and the > Form needs to shown again, the new input field is gone. > > Does anyone got an idea how I could solve this? Thanks a lot. > > Luke > > > --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Add input field with jquery
Hi, I am having a form, where I want the User to be able to dynamically add input fields. I have found some jquery script to achieve this. Everything works fine, besides when I have a validation error and the Form needs to shown again, the new input field is gone. Does anyone got an idea how I could solve this? Thanks a lot. Luke --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---