之前已经问过这个问题,但是我使用了与问题的答案中说的相同的东西,但它没有用 我的表格:
$home=
"<div class='heading' >
<p><b>EHD HOME AUTOMATION</b></p>
</div>
<div class='menu-wrap'>
<nav class='menu'>
<ul class='clearfix'>
<li><a href='./member.php'>$username's Home</a></li>
<li>
<a href='#'>States <span class='arrow'>▼</span></a>
<ul class='sub-menu'>
<li><a href='#' onclick='changeAllStatesToFalse();'>ALL APPLIANCES OFF</a></li>
<li><a href='#' onclick='changeAllStatesToTrue();'>ALL APPLIANCES ON</a></li>
<li><a href='#' onclick='getStates();'>GET STATES</a></li>
</ul>
</li>
<li><a href='#'>Security</a></li>
<li><a href='#'>Page info</a></li>
<li><a href='./logout.php'>Logout</a></li>
</ul>
</nav>
</div>
<!3 Toggle Buttons start>
<div class='buttonsArea'>
<div class='display'>
<label class='label toggle'>
Appliance 1
<input type='checkbox' class='toggle_input' id='button1' name='A1'/>
<div class='toggle-control'></div>
</label>
</div>
<div class='display'>
<label class='label toggle'>
Appliance 2
<input type='checkbox' class='toggle_input' id='button2' onclick='updateTable(2);'/>
<div class='toggle-control'></div>
</label>
</div>
<div class='display'>
<label class='label toggle'>
Appliance 3
<input type='checkbox' class='toggle_input' id='button3' onclick='updateTable(3);' />
<div class='toggle-control'></div>
</label>
</div>
</div>
<!3 Toggle Buttons end>";
if(isset($_POST['A1'])){
echo "<script type='text/javascript'>alert('A1 pressed');</script>";
}
if($username && $userid){
echo "$home";
if($errormsg)
echo "<script type='text/javascript'>alert('$errormsg');</script>";
}
复选框A1没有响应isset功能。无论设置与否,都没有设置回声。 请帮忙 请参阅3切换按钮部分