Yii Framework Forum: generated array textfield - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

generated array textfield

#1 User is offline   darwin15 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 27-January 15

Posted 27 January 2015 - 04:38 AM

how to generate array textfield based on database data retrieve. plss post answers with model,view and controller for me to understand.i wish someone will help me...thanks..
0

#2 User is offline   Fabrizio Caldarelli 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,058
  • Joined: 21-March 13
  • Location:Rome, Italy

Posted 27 January 2015 - 12:23 PM

Explain your problem. Have you multiple fields in db's table and you want many input text as your fields?
Yii2 by example: my book about Yii2
https://www.packtpub...nt/yii2-example
0

#3 User is offline   darwin15 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 27-January 15

Posted 27 January 2015 - 08:09 PM

i have default values in my database table "milestone", and that table has 5 columns, "id,title,Milestone_name,Responsible,duration".

i want to generate a table in a form in view that contains, "Milestone Name, Responsilbe, Duration".

Duration column will be a textfield.. how can i do that??/ plss help me. i want to make textfield an array in order to save it to database as a new data in database....


this is my code in the view to generate the data in the database...

<?php foreach($milestone_list as $milestone_list):
echo '<tr>';
echo '<td>';
echo $milestone_list->Id;
echo '</td>';

echo '<td>';
echo $milestone_list->Milestone;
echo '</td>';

echo '<td>';
echo $milestone_list->Responsibility;
echo '</td>';

echo '<td>';
echo '<div class="row">';
echo $form->labelEx($model,'Duration_Value');
echo $form->textField($model,'Duration_Value[]',array('size' => 3, 'id' => $milestone_list -> Id,'onchange' => 'js:Duration_update('.$milestone_list -> Id.');')). 'Day/s';
echo $form->error($model,'Duration_Value');
echo '</div>';
echo '</td>';


echo '</tr>';
endforeach; ?>
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users