OSC-Sevilla Posted May 7, 2012 Share Posted May 7, 2012 On my products listing page i have the compare contribution. As each product is returned a check box is added, see image. This is the code: $compare_checkbox_list ='<input type="checkbox" title="'.TEXT_COMPARE_CHECKBOX .'" name="checkgroup[]" id="checkgroup" value="'.$featured['products_id'].'"/>'; when validating the page you see this frequently: to solve i want to either add render the id - id="checkgroup" with 1,2.3 etc. presumably this can be done ion the above by some code and in the input id=\"checkgroup\"+i... or to that affect. or by running a function to cange the universal id="checkgroup" by counting them and add 1,2,3.. etc at the end. $(function(){ var i = 1; var i = 1; document.onload= function () { $("<div />") .append($("<input />", { type: "checkbox", id:"checkgroup"+i })) .appendTo("#someContainer"); i++; }); NEED SOME HELP - NOTING WORKING AND I HAVE NO IDEA. Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted May 7, 2012 Author Share Posted May 7, 2012 SOLVED: Simple: '<input type="checkbox" title="'.TEXT_COMPARE_CHECKBOX .'" name="checkgroup[]" id="'.('checkgroup'.$row++).'" value="'.$featured['products_id'].'"/>'; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.