我试图默认选中一个复选框,但我尝试的所有内容似乎都不起作用.我不知道它是否与代码中的
PHP有关.
function show_subscription_checkBox ($id='0') { global $sg_subscribe; sg_subscribe_start(); if ( $sg_subscribe->checkBox_shown ) return $id; if ( !$email = $sg_subscribe->current_viewer_subscription_status() ) : $checked_status = ( !empty($_COOKIE['subscribe_checkBox_'.COOKIEHASH]) && 'checked' == $_COOKIE['subscribe_checkBox_'.COOKIEHASH] ) ? true : false; ?> <p <?PHP if ($sg_subscribe->clear_both) echo 'style="clear: both;" '; ?>class="subscribe-to-comments"> <input type="checkBox" name="subscribe" id="subscribe" value="subscribe" style="width: auto;" <?PHP if ( $checked_status ) echo 'checked="checked" '; ?>/> <label for="subscribe"><?PHP echo $sg_subscribe->not_subscribed_text; ?></label> </p>
我试过了
echo 'checked=\"checked\" '; echo 'checked="checked" ' ; echo 'checked> ';
该插件作者声明您曾经能够默认选中复选框但不再查看.