[FX.php List] Getting checkbox array from FX to Filemaker
Andrew Denman
adenman at tmea.org
Mon Aug 21 15:19:19 MDT 2006
In FileMaker, the checkbox items are stored with each checkable item on a
new line:
$inst = implode("\r\n", $_POST['inst']);
Andrew Denman
-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Edward L. Ford
Sent: Monday, August 21, 2006 10:48 AM
To: FX.php Discussion List
Subject: Re: [FX.php List] Getting checkbox array from FX to Filemaker
I've gotten PHP to correctly parse the checkbox array, but I can't get
the data into FileMaker correctly.
When I get the POST array, I implode it with the following:
$inst = implode(" ", $_POST['inst']);
I then send the value of $inst to FM with AddDBParam.
The data does get into the database -- if I look at the raw XML output
on the record, I can see the data that was in $inst is now contained in
the database.
What I can't seem to do is get the Filemaker checkbox set to display the
values -- in my case, I have a field called Instrument, with a value
list that defines the checkboxes possible. According to the raw XML,
Instrument contains values that match checkbox items from the value
list, but the checkboxes are not actually marked. It appears that a " "
between checkbox items is not sufficient. In what format should I pass
the data from PHP to Filemaker?
All help is appreciated,
--Ed F.
Edward L. Ford wrote:
> List,
> I'm having a hard time getting a set of check box values to interface
> with my PHP class correctly. From what I can tell, I'm not getting an
> array of values through POST; rather, I am getting only the value of
> the last box checked.
>
> The check boxes on my form look like this:
> <td><input class="req" name="inst[]" id="inst1" type="checkbox"
> value="Bassoon" /> Bassoon</td>
> <td><input class="req" name="inst[]" id="inst2" type="checkbox"
> value="Cello" /> Cello</td>
> <td><input class="req" name="inst[]" id="inst3" type="checkbox"
> value="Clarinet" /> Clarinet</td>
> <td><input class="req" name="inst[]" id="inst4" type="checkbox"
> value="Composer" /> Composer</td>
>
> My PHP script that handles the results of the POST has the following
> lines:
> if(isset($_POST['inst']))
> $inst = implode($_POST['inst'],",");
>
> PHP spits back a warning "*Warning*: implode(): Bad arguments. in
> *<server_path>/editentry-submit.php* on line *32"
>
> When I tell PHP to print_r(*$_POST['inst']); I get only the value of
> the last value checked -- no other values.
>
> How can I get the array of check box values? Where am I going wrong?
>
> All help is appreciated,
> --Ed Ford
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list
More information about the FX.php_List
mailing list