Re: [fw-general] multiple forms in the same page and validation problem
mmm... I admit I didn't take sub forms into consideration... I'll try to arrange something with them. Thank you Jurian Sluiman wrote: > > Op Monday 07 September 2009 12:37:24 schreef nulele: >> Hello, >> I've created a page with a jquey tab. Every tab has a zend form. Every >> form >> has its own class. >> >> The problems are: >> >> 1) when a form validation is wrong all forms in the page (in other tabs) >> show errors!! I've already tried to change filed name/id and specify >> action >> attribute without success. >> >> 2) As I cannot detect witch tab is selected to return to it after >> validation... is there a way to detect if a form is updated? >> >> Thanks in advance > > I am not a specialist with Zend_Form, but can subforms solve your problem? > See > the documentation for more information: > http://framework.zend.com/manual/en/zend.form.forms.html#zend.form.forms.subforms > > They are handled as seperate forms, though combined into one Zend_Form > object. > > Regards, Jurian > -- > Jurian Sluiman > Soflomo.com > > > > -- View this message in context: http://www.nabble.com/multiple-forms-in-the-same-page-and-validation-problem-tp25328439p25329765.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] multiple forms in the same page and validation problem
Hello, I've created a page with a jquey tab. Every tab has a zend form. Every form has its own class. The problems are: 1) when a form validation is wrong all forms in the page (in other tabs) show errors!! I've already tried to change filed name/id and specify action attribute without success. 2) As I cannot detect witch tab is selected to return to it after validation... is there a way to detect if a form is updated? Thanks in advance -- View this message in context: http://www.nabble.com/multiple-forms-in-the-same-page-and-validation-problem-tp25328439p25328439.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] custom form element not shown after unsuccessful form validation
hey, really nobody needs to create simple custom html elements in a zend form class? please help me!!! -- View this message in context: http://www.nabble.com/custom-form-element-not-shown-after-unsuccessful-form-validation-tp24512154p24537867.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] custom form element not shown after unsuccessful form validation
Hi, I've been developing a poll form using zend. I've created the form class to dynamically create the form with the poll title, one or more questions and some choices (radio or checkbox) for every question. All form elements are zend_form_element except for the title and the question elements for whom I've created this custom element: class Default_Model_myXhtml extends Zend_Form_Element_Xhtml { public $helper = 'formNote'; } Here's the form class where basic and custom elements are initialized and decorators removed to render the form with my custom form (poll-form.phtml): class Default_Model_PollForm extends Zend_Form { public function __construct($options = null) { parent::__construct($options); ... $customElement = new Default_Model_myXhtml('title'); $customElement->setValue('POLL TITLE'); $this->addElement($customElement); ... $this->setDecorators(array()); $this->addDecorator('ViewScript',array('viewScript'=>'index/poll-form.phtml')); $this->removeDecorator('htmltag'); foreach ($this->getElements() as $element) { $element->removeDecorator('label'); $element->removeDecorator('errors'); $element->removeDecorator('htmltag'); $element->removeDecorator('DtDdWrapper'); } } } Then in the poll-form.phtml: ... element->title ?> ... The problem is that after validating the form, if the validation fails I see the form with all basic elements except for my custom elements. Is there a way to create custom html elements inside a zend form and make them behave like other zend form elements? Thanks -- View this message in context: http://www.nabble.com/custom-form-element-not-shown-after-unsuccessful-form-validation-tp24512154p24512154.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] how to force zend form to submit to new action
Thank you for your attempt but unfortunately this method doesn't work... if the form is valid I simply see the form again... Maybe I need something to capture the post request from the form and send it to the pommo's page... but how? Eugene Morgan wrote: > > If I understand correctly what you are trying to do, I think all you > need to do is immediately after you instantiate the $newsletterForm, > set its action to what you want (not after it's posted) ... > > i.e., > $newsletterForm = new Default_Model_NewsletterForm(); > $newsletterForm->setAction('/areaprivata/pommo/user/process.php'); > > Does that help? > > On Wed, Jul 15, 2009 at 5:08 AM, nulele wrote: >> >> hello nabble!! >> I'm trying to integrate my zend application with pommo. >> I don't want to replicate pommo's logic on new user subscription by >> creating >> zend_db objects for every pommo's table... I just want to: >> >> 1) create the subscription form with zend_form, >> 2) validate the form on zend side >> 3) submit the form to the pommo's page used to insert new user >> >> I've already completed the first 2 steps... here's the code in my >> controller >> to validate the form: >> >> public function newsletterAction() >> { >> $newsletterForm = new Default_Model_NewsletterForm(); >> $this->view->newsletterForm = $newsletterForm; >> >> if ($this->getRequest()->isPost()) >> { >> $formData = $this->getRequest()->getPost(); >> >> if ($newsletterForm->isValid($formData)) >> { >> >> $newsletterForm->setAction('/areaprivata/pommo/user/process.php'); >> >> HERE GOES THE MISSING CODE # >> >> >> >> } >> else >> { >> $newsletterForm->populate($formData); >> } >> } >> } >> >> If anyone has an idea, please let me know. >> Many Thanks >> >> -- >> View this message in context: >> http://www.nabble.com/how-to-force-zend-form-to-submit-to-new-action-tp24495073p24495073.html >> Sent from the Zend Framework mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/how-to-force-zend-form-to-submit-to-new-action-tp24495073p24511659.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] how to force zend form to submit to new action
hello nabble!! I'm trying to integrate my zend application with pommo. I don't want to replicate pommo's logic on new user subscription by creating zend_db objects for every pommo's table... I just want to: 1) create the subscription form with zend_form, 2) validate the form on zend side 3) submit the form to the pommo's page used to insert new user I've already completed the first 2 steps... here's the code in my controller to validate the form: public function newsletterAction() { $newsletterForm = new Default_Model_NewsletterForm(); $this->view->newsletterForm = $newsletterForm; if ($this->getRequest()->isPost()) { $formData = $this->getRequest()->getPost(); if ($newsletterForm->isValid($formData)) { $newsletterForm->setAction('/areaprivata/pommo/user/process.php'); HERE GOES THE MISSING CODE # } else { $newsletterForm->populate($formData); } } } If anyone has an idea, please let me know. Many Thanks -- View this message in context: http://www.nabble.com/how-to-force-zend-form-to-submit-to-new-action-tp24495073p24495073.html Sent from the Zend Framework mailing list archive at Nabble.com.