mardi 19 juin 2018

name the variable value of checkbox with elements of an array [on hold]

I try to put in the value variable of the checkbox the content of the element element (that is $ new_category_to_send) of the array $ suggest, but when I run it shows me of value forward as a string. In the case of the variable that I use for the id ($ cont_add_checkbox) which is an integer, I have no problem.

Who could tell me what is failing? how to store the variable is not correct ??

foreach ($suggest as $new_category_to_send) {
        echo "<br>".'<input type="checkbox" id='. $cont_add_checkbox .' value='. $new_category_to_send .' class="chb" href="#" onclick="javascript:func(this.id, this.value);">'.$new_category_to_send.'</imput>';

enter image description here




Aucun commentaire:

Enregistrer un commentaire