html程式碼:
<span><</span><span>tr</span><span>></span><span><</span><span>td</span><span>><</span><span>input </span><span>type</span><span>="checkbox"</span><span> name</span><span>="uid"</span><span> value</span><span>="<?=$item['mtaccount_id']?>"</span><span>></</span><span>td</span><span>></span><span><</span><span>td</span><span>></span><span><?</span><span>=$item['mtaccount_id']</span><span>?></span><span></</span><span>td</span><span>></span><span><</span><span>td</span><span>></span><span><?</span><span>=$item['account_id']</span><span>?></span><span></</span><span>td</span><span>></span><span><</span><span>td</span><span>></span><span><?</span><span>=$item['account_name']</span><span>?></span><span></</span><span>td</span><span>></span><span><</span><span>td</span><span>></span><span><?</span><span>=$item['server']</span><span>?></span><span></</span><span>td</span><span>></span><span><</span><span>td</span><span>></span><span><?</span><span>=$item['platform']</span><span>?></span><span></</span><span>td</span><span>></span><span></</span><span>tr</span><span>></span>
我的是html裡的資料是從資料庫讀出來的,在此可以理解為下面程式碼
<span><</span><span>li</span><span>><</span><span>input </span><span>type</span><span>="checkbox"</span><span> name</span><span>="uid"</span><span> value</span><span>="1"</span><span>/></span>用户1<span></</span><span>li</span><span>></span><span><</span><span>li</span><span>><</span><span>input </span><span>type</span><span>="checkbox"</span><span> name</span><span>="uid"</span><span> value</span><span>="2"</span><span>/></span>用户2<span></</span><span>li</span><span>></span><span><</span><span>li</span><span>><</span><span>input </span><span>type</span><span>="checkbox"</span><span> name</span><span>="uid"</span><span> value</span><span>="3"</span><span>/></span>用户3<span></</span><span>li</span><span>></span><span><</span><span>li</span><span>><</span><span>input </span><span>type</span><span>="checkbox"</span><span> name</span><span>="uid"</span><span> value</span><span>="4"</span><span>/></span>用户4<span></</span><span>li</span><span>></span>
jquery代碼: // $gid 可忽略
以上就介紹了jquery獲取多個checkbox的值非同步提交給php,包括了方面的內容,希望對PHP教程有興趣的朋友有所幫助。