i have some fields in my database table,and a field with phone name , i save value to this filed like this 111-222-5555
now i want to read all of my fields , and populate to my form , i like populate phone filed to 3 elements(as text element)
when i try this code
$id = $this->_request->getParam ( 'id' );
$values = $cutomModel->findCustomerById($id);// return array of row
$frm->populate($values);
all fields show in form except phone field ,
how can i populate phone field to 3 elements
thanks
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.
Finally, before inserting form input into your database you must combine the input from the 3 fields into 1 field.