PHP Classes

Reading changed check boxes: Need to read changes in check boxes

Recommend this page to a friend!
  All requests RSS feed  >  Reading changed check boxes  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

Reading changed check boxes


Picture of Lalo Celi by Lalo Celi - 6 years ago (2017-07-06)

Need to read changes in check boxes

This request is clear and relevant.
This request is not clear or is not relevant.


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 Clarification request
  • 1. Picture of zinsou A.A.E.Mo´se by zinsou A.A.E.Mo´se - 6 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. Picture of Lalo Celi by Lalo Celi - 5 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.

Ask clarification

1 Recommendation

PHP Forms Class with HTML Generator and JavaScript Validation: HTML forms generation and validation.

This recommendation solves the problem.
This recommendation does not solve the problem.


Picture of zinsou A.A.E.Mo´se by zinsou A.A.E.Mo´se Reputation 5835 - 6 years ago (2017-08-12) Comment

study this package to know how to handle checked boxes...

Recommend package