[FX.php List] Multiple FMEdits from a List View
Jonathan Schwartz
jschwartz at exit445.com
Sat Dec 6 11:56:08 MST 2008
Hi David,
Bet you killed some brain cells on this one...like I did. ;-)
Here's what I do, as assisted by ggt.
1) Instead of making each line item it's own POST form, put the form
tags at the top and bottom so that they surround all the lines.
2) Add the following square brackets to the input field name. Example:
<input type ="text" name="myfieldname" >
gets changed to
<input type ="text" name="myfieldname[]" >
This tells PHP to create an array containing an entry for each row
submitted, allowing multiple fields with the same name to be
submitted.
Then, on the page receiving the POST, you loop through the POSTed
values and perform an edit for each.
To see what is happening, print out the POST on the target page:
echo "<pre">;
print_r($_POST);
echo "</pre>";
One wrinkle, In this case, you need to also have the recid in order
to perform an edit. More than one way to do this. One way: repeat
the above steps with a hidden input field that contains recid. Then
you have two arrays, one containing the inpt value, and one with the
recid. In looping thru, you simply call the same array element from
each array to retrieve the corresponding value and recid.
Hope that helps. Let me know if you need the looping script.
J
At 6:39 PM -0500 12/5/08, David Walton wrote:
>I have a page which returns data from a collection of records, 20 or so.
>
>I wish to enter values on some or all of the records, making simple
>selections from a drop-down list.
>
>I want to click Submit and have the value submit to the individual records.
>
>I recognize several possible ways to do this -- 20 submits; or edit
>a single field and use a script.
>
>Would anyone be able to give me a push in the right direction? Thanks, if so.
>
>DSW
>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list
--
Jonathan Schwartz
Exit 445 Group
jonathan at exit445.com
http://www.exit445.com
415-370-5011
More information about the FX.php_List
mailing list