Probably you want to use a jQuery for that. muster: 1) Create a jQuery function onChange con_id select - do an ajax call of some action 2) in that action return (json) data with an id which you wan't to select in the the state_id select 3) then the jQuery callback function will add the selected atribute to this option
On 3 kvě, 10:26, Md Mostafizur Rahman milon <cse...@gmail.com> wrote: > my a form definition is follows:- > > $this->setWidgets(array( > 'id' => new sfWidgetFormInputHidden(), > 'username' => new sfWidgetFormInputText(), > 'email' => new sfWidgetFormInputText(), > 'algorithm' => new sfWidgetFormInputText(), > 'salt' => new sfWidgetFormInputText(), > 'password' => new sfWidgetFormInputText(), > 'is_active' => new sfWidgetFormInputCheckbox(), > 'is_super_admin' => new sfWidgetFormInputCheckbox(), > 'last_login' => new sfWidgetFormDateTime(), > 'CName' => new sfWidgetFormInputText(), > 'firstName' => new sfWidgetFormInputText(), > 'lastName' => new sfWidgetFormInputText(), > 'address1' => new sfWidgetFormInputText(), > 'address' => new sfWidgetFormInputText(), > 'con_id' => new > sfWidgetFormDoctrineChoice(array('model' => > $this->getRelatedModelName('Country'), 'add_empty' => true)), > > 'state_id' => new > sfWidgetFormDoctrineChoice(array('model' => > $this->getRelatedModelName('State'), 'add_empty' => true)), > > 'city' => new sfWidgetFormInputText(), > 'zip' => new sfWidgetFormInputText(), > 'phone' => new sfWidgetFormInputText(), > 'created_at' => new sfWidgetFormDateTime(), > 'updated_at' => new sfWidgetFormDateTime(), > 'groups_list' => new > sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => > 'DmGroup', 'expanded' => true)), > 'permissions_list' => new > sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => > 'DmPermission', 'expanded' => true)), > )); > > here State depend on Country. > > now i want add Ajax call back options when change field con_id > callback the method through ajax > and this change the field state_id. > how is possible? > help me > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en