Hello,
I have a checkbox on my UI. When the users clicks on the checbox, I want a service to be called. If by clicking on the checkbox, the checkbox has gone from unselected to selected, service 1 will be called. If by clicking on the checkbox the checkbox has gone from selected to unselected, service 2 will be called (both services are database services, the second one creating a new object on the database, the first one deleting it).
Therefore, I have created an event upon my checkbox that makes JavaScript run when the user clicks on the checkbox. This is the JS that is executed:
if (Appery('myCheckbox').attr("checked")){
service1.execute();
}
else {
service2.execute();
}
Is this correct? For some reason, only the service2 is performed. The first if clause is never performed. Is there anything I'm not doing properly on the JS?
Thank you.