我正在制作一个分三个阶段提交的表格。在每个阶段,将设置一个新的会话变量。在设置任何会话变量之前,其他2个按钮应在 mouseenter 上保持禁用状态,并应在 mouseleave 上启用。
这是我到目前为止所尝试过的内容,但并非如此:
session_start();
if(isset($_SESSION['variable1']))
echo "<style> .signal1{ background-color: #5cb85c !important;
}
</style>";
if(isset($_SESSION['variable2']))
echo "<style> .signal2{ background-color: #5cb85c !important;
}
</style>";
else{?>
<script>
$(document).ready(function(){
$(".signal2").on({
mouseenter: function(){
$(this).attr("disabled","disabled");
},
mouseleave: function(){
$(this).removeAttr("disabled");
}
});
});
</script>
<?php }
if(isset($_SESSION['variable3']))
echo "<style> .signal3{ background-color: #5cb85c !important;
}
</style>";
else{?>
<script>
$(document).ready(function(){
$(".signal3").on({
mouseenter: function(){
$(this).attr("disabled","disabled");
},
mouseleave: function(){
$(this).removeAttr("disabled");
}
});
});
</script>
<?php }
?>