使用数组从动态表单提交值

使用数组从动态表单提交值

问题描述:

I have been trying to create a dynamic To-DO Template list, with preassigned items, descriptions, etc. The idea is to pull a template list from a table that will change from time to time. From there the user will uncheck to-dos from the template task list that they don't need to be inserted into another list or "TABLE".


| EXAMPLE |

I ended up with code similar to this.

$todo_toaddornot = $_POST['toaddornot'];
$value1 =$_POST['value1'];
$value2 =$_POST['value2'];
for($i=0;$i<count($todo_name);$i++)
        {   //If Mark Yes Then Show
        if($todo_toaddornot[$i]==='Yes')
        { echo $value1[$i]; echo $value2[$i]; }}