我有一個複選框,將其狀態(選中/取消選中)保存在MySQL數據庫中。例如有一個在https://encrypted.coxnetworks.co.uk/school/includes/Checkboxes/Monday1/checkbox.php(它受密碼保護)。取消選中複選框(在數據庫中保存狀態)在PHP中
頁面上的代碼被
<form id='checkbox' method="post" action='/school/includes/Checkboxes/Monday1/checkbox.php'><!-- php: get the name+location of the webpage -->
<input type="hidden" name="confirm" value="1"> <!-- give confirm a value -->
<input type="checkbox" checked name="checkbox" value="1" onclick="document.forms['checkbox'].submit()"/> <!-- submit the form when checkbox is clicked -->
</form>
因此它使用JavaScript張貼到PHP。不過,我希望能夠點擊一個按鈕啓動腳本來取消選中這些腳本的負載。我怎麼能這樣做?
雖然它們是通過iFrames「包含」的,但不是直接在頁面中,所以javascript解決方案並不真正起作用。對不起應該說了。 – 2012-03-06 18:07:22