0
    <li>
        Assign Task to Every User? &nbsp; &nbsp; 
        <input type="checkbox" name="display_insert_email" onchange="this.form['email'].hidden=this.checked" />
    </li>
    <li>
        <input type="text" name="email" style="width: 400px;" value="<?php if ($task_member_id > 0){ echo $task_member_email; } else 'Please enter email address of user'?>" onclick="if(this.value=='Please enter email address of user'){this.value=''}" onblur="if(this.value==''){this.value='Please enter email address of user'}" >
    </li>

这是两个有问题的区域,如果$project_member_id = 0我希望复选框的值被选中..

我已经搜索和搜索,但我找不到与我相关的任何内容,我可能正在搜索错误的内容,但任何帮助将不胜感激!

4

4 回答 4

1
<input type="checkbox" <?php if($var == '0'){ ?> checked <?php } ?>/>
于 2013-04-16T16:14:35.777 回答
1

只要echo checked条件为真

<input type="checkbox" value="1" <?php if($val == '1') {echo 'checked';} ?> />
于 2013-04-16T16:15:32.937 回答
1

<input type="checkbox" <?php if($variable == 1){ echo "checked"; } ?> >

于 2013-04-16T16:19:40.483 回答
1

<input type="checkbox" value="1" <?php if($project_member_id == 0) echo 'checked="checked"'; ?> >

于 2013-04-16T17:55:45.377 回答