【问题标题】:how to make checkbox check in php echo if one is checked如果选中一个,如何在 php echo 中进行复选框检查
【发布时间】:2019-07-04 15:53:14
【问题描述】:

我从多个复选框获取数组输入,但我想要两种不同类型的值集(电子邮件组合和名称组合)

echo '<br/>
<input type="checkbox" name="select_dept[]" value="'.$email.'" id=id1['.$i.'] onclick="if(document.getElementById(id1['.$i.']).checked){ document.getElementById(id2['.$i.']).checked=true"} >
<input type="checkbox" name="select_dept_name[]" value="'.$name.'" id=id2['.$i.']>'
.$id.' &nbsp '.$name.' &nbsp '.$mobno;

【问题讨论】:

  • 并且这段代码与 $i 循环;

标签: javascript php html


【解决方案1】:

Binding two checkboxes together

这件事解决了问题 回声'
';

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-05-26
    • 2019-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-21
    相关资源
    最近更新 更多