vendredi 21 avril 2017

JQuery Checkbox passing variable

Collection : 1 Weekly BI Weekly Collection : 2 Weekly BI Weekly

I have list of checkboxes with the values, in JQuery, when the user submit, I have to retrieve the list of checked values.
I need to pass ID paratmert in the Jquery , in order to get list of checkbox values.

  var id = $(this).attr('id');
var selectedBillingCycleEdit = [];

$.each($("input[name='acctsEdit_57']:checked"), function()
{      
                              selectedBillingCycleEdit.push($(this).val());
});

I tried to pass Id variable instead of _57, can you please any one help me to resolve the issue.

   $.each($("input[name='acctsEdit_' + id]:checked")     

I tried to pass + id in the above, i am getting error.




Aucun commentaire:

Enregistrer un commentaire