mercredi 27 avril 2016

How to disable default chekbox checked to unchecked by user

I have generate a checkbox using php like this :

<?php
   foreach ($tipe as $v):
       if ($v->ID_CHECK_LIST != 5) {
            echo "<label class='checkbox-inline'>"
               . "<input type='checkbox' name='tipe[]' value='$v->ID_CHECK_LIST'>$v->NAMA_CHECK_LIST"
                . "</label>";
       }else{
            echo "<label class='checkbox-inline'>"
           . "<input type='checkbox' name='tipe[]' value='$v->ID_CHECK_LIST' checked>$v->NAMA_CHECK_LIST"
           . "</label>";
      }

    endforeach;
  ?>

My question is, is it possible to prevent user to change the default cheklist that have checked based code above, which is the 5th checkbox that have value="5". But, The another checkbox still can be checked/unchecked by user.

I know a little about jquery.js. Any suggestion it so appreciated.




Aucun commentaire:

Enregistrer un commentaire