vendredi 29 avril 2016

how would I pull the data out of the database and re-check the checkboxes that were originally checked and submitted?

I entered checkbox values into the database using the code below. When a user wants to view the checked boxes at a later time, how would I pull the data out of the database and re-check the checkboxes that were originally checked and submitted?

From the code below the data gets entered like this: DATA1|DATA2|DATA3|

var checkbox_value = "";
    $(":checkbox").each(function () {
        var ischecked = $(this).is(":checked");
        if (ischecked) {
            checkbox_value += $(this).val() + "|";
        }
    });

Now how to I take DATA1|DATA2|DATA3| and re-check the corresponding checkboxes?




Aucun commentaire:

Enregistrer un commentaire