How to populate a value in some element using zend_form?

If I understand your question correctly, firstly you need to create 3 separate form fields (something along the lines of phone_1, phone_2 and phone_3) to hold the 3 separate phone segments. Then before populating the fields, separate the database output of 1 field into 3 fields.

If I understand your question correctly, firstly you need to create 3 separate form fields (something along the lines of phone_1, phone_2 and phone_3) to hold the 3 separate phone segments. Then before populating the fields, separate the database output of 1 field into 3 fields. $id = $this->_request->getParam ( 'id' ); $values = $cutomModel->findCustomerById($id);// return array of row // split phone number into 3 values list($values'phone_1', $values'phone_2', $values'phone_3') = explode('-', $values'phone', 3); $frm->populate($values); Finally, before inserting form input into your database you must combine the input from the 3 fields into 1 field.

$values = $frm->getValues(); // combine phone number into 1 value $values'phone' = implode('-', $values'phone_1', $values'phone_2', $values'phone_3') $cutomModel->insert($values).

From what I (hardly) understood, you are trying to fill 3 elements of a form with the content of one field (phone) in your database table. To achieve this you can use the setDefault() method of the Zend_Form object. Something like this: $frm->setDefault('field_name', $values->phone); Do this after populate() and for every field that you want a customized value to be filled.

It dose not work – user1400 Apr 5 '10 at 17:30.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions