Jump to content

This topic is 6840 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have an FMP file with a field with a checkbox attached and data entered (i.e. Interests).

Using FX, I can take the querried results, explode it, and have multiple checkboxes appear checked on an edit Form.

However, I cannot resubmit the results to the FMP file, even if I don't change the data. I am able to implode it prior to sending it back, creating a single-line string (i.e. hiking, math, swimming), but then the checkboxes don't work on that end.

Does anyone know the code I would need to reorganize the data prior to using FMEdit() to submit the results to the file?

Thanks, as always.

DSW

  • Newbies
Posted

A couple of things (my apologies if you're already doing these...):

* Use the empty bracket syntax -- "[]" -- on the PHP side to automagically create an array from the submitted check boxes.

* When you implode the resulting array to submit it to FileMaker, make sure that you using the newline character -- "n" -- to separate the items, since this is how they're separated in FileMaker.

HTH

  • 2 years later...
Posted

I can't get this to work for me. I can explode the field using explode("n", $Field) and then use in_array() to display the checkboxes, with the proper checkboxes checked. OK, so far.

But, if I then subsequently use implode("n", $Field) before submitting it back to the database, I get a PHP bad argument warning for the implode() function and $Field in the database becomes blank.

If I do not use Field[] to collect the checkbox values and do not use implode, then only the last checked value gets submitted to the database

So, what am I doing wrong? It seems it should work, but it doesn't.

Thanks

William

This topic is 6840 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.