Checkbox set w/ multiple values

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Checkbox set w/ multiple values

John Torres-3
I'm searching the archives with no luck. Trying to find an example of how to handle a checkbox set when multiple values for the set will be selected by the user, and those values will then need to be added to a new record in a FMP field that has been set up as a checkbox set with an assigned value list.

The example is an event registration form. The user can register for each day of the 3-day conference separately. I've set up the days of the conference as options in a checkbox set. Any examples to share? Running Lasso 9.3 FMP/FMS 14.

Thanks,
John
[hidden email]







#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Checkbox set w/ multiple values

Jolle Carlestam-2
2 maj 2017 kl. 05:20 skrev John Torres <[hidden email]>:
>
> I'm searching the archives with no luck. Trying to find an example of how to handle a checkbox set when multiple values for the set will be selected by the user, and those values will then need to be added to a new record in a FMP field that has been set up as a checkbox set with an assigned value list.
>
> The example is an event registration form. The user can register for each day of the 3-day conference separately. I've set up the days of the conference as options in a checkbox set. Any examples to share? Running Lasso 9.3 FMP/FMS 14.
>
> Thanks,
> John

I can’t help you with the Filemaker part, I don’t do Filemaker. But for the Lasso handling I strongly suggest you go grab the wrp type on Gist.
https://gist.github.com/jolle-c/d72c8af689cb7e79ccc1

Once installed you can change all your web_request -> param(’xx’) calls to wrp(’xx’). When it comes to checkbox input handling you simply add a second param -all. Example:
wrp(’mycheckbox’, -all)
This will always return a staticarray with 0 to X values depending on how many checkboxes that were ticked.
Had this been Mysql I would then join them into a string and put in a field.
wrp(’mycheckbox’, -all) -> join(’\n’)

Hope this helps.

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Checkbox set w/ multiple values

John Torres-3
Jolle,

Thanks for pointing me back in the direction of the wrp type. This did the trick. In FileMaker, checkbox set values are separated by carriage returns so I simply modified your example to:

wrp('mycheckbox', -all) -> join('\r')

And that worked like a charm.

Thanks so much.
John

On May 2, 2017, at 2:01 AM, Jolle Carlestam <[hidden email]> wrote:

> 2 maj 2017 kl. 05:20 skrev John Torres <[hidden email]>:
>>
>> I'm searching the archives with no luck. Trying to find an example of how to handle a checkbox set when multiple values for the set will be selected by the user, and those values will then need to be added to a new record in a FMP field that has been set up as a checkbox set with an assigned value list.
>>
>> The example is an event registration form. The user can register for each day of the 3-day conference separately. I've set up the days of the conference as options in a checkbox set. Any examples to share? Running Lasso 9.3 FMP/FMS 14.
>>
>> Thanks,
>> John
>
> I can’t help you with the Filemaker part, I don’t do Filemaker. But for the Lasso handling I strongly suggest you go grab the wrp type on Gist.
> https://gist.github.com/jolle-c/d72c8af689cb7e79ccc1
>
> Once installed you can change all your web_request -> param(’xx’) calls to wrp(’xx’). When it comes to checkbox input handling you simply add a second param -all. Example:
> wrp(’mycheckbox’, -all)
> This will always return a staticarray with 0 to X values depending on how many checkboxes that were ticked.
> Had this been Mysql I would then join them into a string and put in a field.
> wrp(’mycheckbox’, -all) -> join(’\n’)
>
> Hope this helps.
>
> HDB
> Jolle
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>