|All requests||>||Reading changed check boxes||>||Request new recommendation||>||Featured requests||>||No recommendations|
by Lalo Celi - 3 years ago (2017-07-06)
The page has: 1. A drop-down (Countries) Based on that drop-down value I call an Ajax PHP file to get the cities in that country (just a few). 2. The rest is a list of the cities (one-to-many) that have a "status" and the check-boxes are used to activate or deactivate a city. There is only a few cities that are of importance to the users, and any can be taken out at any time they need to (deactivate), or activate if need be.
The user can go through the list and activate/deactivate all he/she needs to change status on, then they save at the end.
THE PROBLEM: I don't know how to read the changes when the user hits the "Save" button. I have thought of another Ajax file to compare the current state of the check-box versus what is in the database, but if there is a better way to do it, can someone please let me know?
Thank you very much
1. by zinsou A.A.E.Mo´se - 3 years ago (2017-08-12) Reply
hi, sorry for answering a little late. The best way to do is to check the status before display the forms. So what you just need to do after is to use checked attribut on <input>.If user has already checked it once you display a checked box. So if user changes something when he will send the form you handle it normally as if it is a new form...
2. by Lalo Celi - 3 years ago (2017-10-03) in reply to comment 1 by zinsou A.A.E.Mo´se Comment
Thank you for your reply, I wrote an AJAX function that did the job a few days after posting the question, but thank you anyway.
study this package to know how to handle checked boxes...