Update Dabase using jquery

I have a report of all user. Each user have status Active,inactive other.

Upon clicking on each of the radio buttons I need to update the database.

I don't seems to getting this to work.

Please advice.

LVL 19
erikTsomikSystem Architect, CF programmer Asked:
Who is Participating?
$(":radio[name='your_group_button_name']").click(function() {

      // choose one :

      //button = $(this).index(":radio[name='your_group_button_name']"); // method 1, we use the index of the button in the list
      //button = $(this).val(); // method 2, we use the value of the button
      //button = $(this).attr("id"); // method 3, we use the id of the button
      //button = $(this).next("label").html(); // method 4, we use the html of the label
      //button = $(this).previous("span").html(); // method 5, we use the html of the label
      button = $(this).attr("id").replace("blablabla",""); // method 6, we use the id of the button and we replace the prefix
      // and so on...

      $.post("/path/to/update.ext", { "button": button} )

Open in new window

jQuery ajax is the way to go ...

erikTsomikSystem Architect, CF programmer Author Commented:
That is fine except Jquery ca not differentiate which radio button was clicked
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.