Here is what I have:
the input type text boxes are dynamically rendered from the database. code as follow:
{foreach from = $folderslist item=List}
<input type="text" name="{$List.widgetid}" id="wcolor" value="{$List.color}" maxlength="6" onChange="display_screenplay_color('fcolor_id',this.value)" style="width:48px;">
<span style="color:#{$List.color}">{$List.items} </span>
{/foreach}
the column is widgetid.
so for each widgetid we want the field name and a textbox next to it with an id="$idfromdb"
That way after you hit SUBMIT it posts all the data. I want a loop that will update the db with the values of the textbox. I was wondering if I can Loop through $_POST but use regular expressions since all widget ids start with a “w” OR I can get the submitted value $_POST of each textbox, their ids start with a “w”. or any other ideas/suggestions?
you can use
name[]orname[id]as the name of an input and PHP will convert this into an associated array for you.$_POST will include this information
you can now loop though this with