How to handle checkboxes

Hi there,

I’m totally new to dhtmlx and I try to create a form with a couple of checkboxes that should be stored to the a database. I tried the “contact manager” tutorial and used that project as a starting point. Now I want to add some checkboxes to the form and store their state into the DB but I can’t find any clue how to handle them. Is there any tutorial or a code example how I can send their values over a connector to the DB?

Thanks for your help
dan

Hi

here is a demo:
dhtmlx.com/docs/products/dhtmlxF … radio.html

open console and try the following:

myForm.setItemValue("ch1","0");

see how “Lines number” chnaged, then try

myForm.setItemValue("ch1","1");

see how it chnaged one more time.

so if you have database with ‘ch1’ field, myForm.load() wait the following struct:

<data><ch1>1</ch1></data>

or

<data><ch1>0</ch1></data>

depending on this checkbox will be checked after form data loaded or not.

here is a demo for data loading:
dhtmlx.com/docs/products/dhtmlxF … _load.html

the same for saving. you need to attachEvent(“onChange”, function(name,value){}) and send data to server.

events demo:
dhtmlx.com/docs/products/dhtmlxF … vents.html

send data to server demo:
dhtmlx.com/docs/products/dhtmlxF … _send.html

hope this will help