CodeIgniter Forums
problem catching form value - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: problem catching form value (/showthread.php?tid=27313)

problem catching form value - El Forum - 02-07-2010

heres my code form with looping textarea:

Quote:<? echo form_open('admin/addLesson'); ?>
<input type="hidden" name="lessnum" value="<? echo $lessNum; ?>" />
&lt;? for($a=1; $a<=$lessNum; $a++){ ?&gt; <----$lessNum is value that i got from another page.
Lesson Title: &lt;input type="text" name="&lt;? echo 'title'.$a; ?&gt;" /&gt;
&lt;textarea name="&lt;? echo 'content'.$a; ?&gt;"&gt;&lt;/textarea>
&lt;? } ?&gt;
&lt;input type="submit" value="Next" /&gt;
&lt;? echo form_close(); ?&gt;

the problem is that i cant get the value on looped items which is title and content.

here my controller:

Quote:function addLesson() {

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.

problem catching form value - El Forum - 02-07-2010

How about