要用onclick吗?直接用form传值不可以吗??

解决方案 »

  1.   

    用form传值可以的,但是我要保存多个复选框的值,怎么办?
      

  2.   

    复选框的名字一样,然后用print_r($_POST[名字])看看就知道乐
      

  3.   

    <iframe name='save' width=200 height=200>//如果不想看到结果,将其width=0 height=0
    </iframe>
    <form method='post' action='save.php' target='save'>
    <input type='checkbox' name='check[]' value=1>
    <input type='checkbox' name='check[]' value=2>
    <input type='checkbox' name='check[]' value=3>
    <input type=submit name='submit' value='保存'>
    </form>save.php
    ----------------------------------
    if (isset($_POST['submit']))//处理得到的复选框信息
       print_r($_POST['check']);