Joao Marcos Barbosa Oliveira
Posts: 0
Joined: Sat Jan 04, 2014 2:30 pm

Variable create_service with Checkbox

I have a Checkbox item that are loading data from my DataBase. It has a variable number of items. I want to do a create_service with this item. For each item that is selected in this Checkbox I have to insert value in my another collection. How I do that?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Variable create_service with Checkbox

Hello! You would need to retrieve all checked values using JS and invoke Create service for them.

Joao Marcos Barbosa Oliveira
Posts: 0
Joined: Sat Jan 04, 2014 2:30 pm

Variable create_service with Checkbox

When I use the create_service all the items, including the not selected, are inserted in one record into the Database. I want that just the selected items are include into the Database in separate inserts.

Joao Marcos Barbosa Oliveira
Posts: 0
Joined: Sat Jan 04, 2014 2:30 pm

Variable create_service with Checkbox

How can I do that? Have some step by step tutorial?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Variable create_service with Checkbox

Using JS you have to select all checked checkboxes in a group and for each one invoke Create service passing values as parameters. This should help http://docs.appery.io/documentation/r... (see Invoking a service from JavaScript section). For example preAppery("checkboxgroupName").find("input:checked").each(function(){
createServiceName.execute({"data": {"paramName": $(this).val()});
})/pre

Return to “Issues”