Answer the question
In order to leave comments, you need to log in
Yii find out id textfield?
I create fields like this
for($i = 0; $i < count($rows); $i++)
{
echo CHtml::label($rows[$i]['name'], $rows[$i]['name']);
echo CHtml::textField('elem[]','',array('id'=>$rows[$i]['name']));
}
foreach($_POST['elem'] as $check)
{
$Ids = $_POST['elem'];
};
array(2) {
[0]=>
string(3) "231"
[1]=>
string(1) "4"
}
Answer the question
In order to leave comments, you need to log in
You can find out on the frontend in your case with the help of some jquery.
No way on the backend, because you didn't pass the information by id in the form.
Names should be set like this:
$id = rows[$i]['name'];
echo CHtml::textField('elem[$id][]','',array('id'=>$id));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question