[eluser]KrizzAngel[/eluser]
heres my code form with looping textarea:
Quote:<? echo form_open('admin/addLesson'); ?>
<input type="hidden" name="lessnum" value="<? echo $lessNum; ?>" />
<? for($a=1; $a<=$lessNum; $a++){ ?> <----$lessNum is value that i got from another page.
Lesson Title: <input type="text" name="<? echo 'title'.$a; ?>" />
<textarea name="<? echo 'content'.$a; ?>"></textarea>
<? } ?>
<input type="submit" value="Next" />
<? echo form_close(); ?>
the problem is that i cant get the value on looped items which is title and content.
here my controller:
Quote:function addLesson() {
$num=$this->input->post('lessnum');
for($s=1;$s<=$num;$s++){
$new="title".$s;
echo "tester".$this->input->post('title$s');
}
}
what i was getting is if the number of loop is two.. ill get testertester.. cant get the post value.