BLHTML.org

Post and database management / basket /

 
  Hantera flera checkboxar with ett field 2735 0
Exemplet shows how you using an integer 8 bits field can handle 8 checkboxar i en datalist.

// attribute defalt sätter vilka checkboxar som skall vara satta som standard
#FIELDMIN name(cb) type=int8 default(0)# // Datafield som manage upp to 8 checkboxar

// Create en valfri variablel som exekveras fore anrop of datapage "Write post":
#$cbi=_checkbox# // Example $cbi

#READ#<tr>
        <td>#DATA[remove] post=new prefix=id type=checkbox class=std#</td> // Kryssruta att radera post
        <td>#DATA[id] post=new prefix=id cols=2#</td> // Shows key field
        <td noWrap>
                #DATA[cb] post=new prefix=id type=checkbox bit=0# // Kryssrutor 0 to 7
                #DATA[cb] post=new prefix=id type=checkbox bit=1#
                #DATA[cb] post=new prefix=id type=checkbox bit=2#
                #DATA[cb] post=new prefix=id type=checkbox bit=3#
                #DATA[cb] post=new prefix=id type=checkbox bit=4#
                #DATA[cb] post=new prefix=id type=checkbox bit=5#
                #DATA[cb] post=new prefix=id type=checkbox bit=6#
                #DATA[cb] post=new prefix=id type=checkbox bit=7#
                #DATA[cb_$id$cbi] post=hidden value=1# // Talar if for basket att variable $cb är en checkbox
                #$cb# // Shows value on $cb satta with ovanstående checkboxar
        </td>
</tr>

More information:
BLHTML forum  


apache MySQL PHP No to software patents! BLHTML
© 2003, 2010 BLHTML
This page is created with BLHTML in 0.0825 seconds