views:

12

answers:

1

hi i have created a country select box as $country= new Zend_Form_Element_Select('country'); in my user registration form .. While selecting an country an ajax call is send and getting the state list by creating another select box $state= new Zend_Form_Element_Select('state'); in another action say stateAction()

Problem is that when i tried to validate registration form in the POST action i cant retrieve the value from state $form = new Users_Form_Register(); eg as $userObjectDetails->statename=$form->getValue('state');

as a solution i added tried to added a dummy variable $state in Users_Form_Register(); add addElement($state),unfortunately during value is loaded by ajax call the state list issue occure during validation of the form

please suggest a solution for the above Thank you

A: 

You could try validating with javascript. jQuery has a nice validation plugin that lets you attach the validator to the form ID and define the rules you want to validate.

gaoshan88