krmreddy Posted December 21, 2007 Share Posted December 21, 2007 Hello, Please help me to change the data in a html table when a checkbox is clicked. I am filling the table with some data in the foam load using PHP, when the check box is checked i want to reload the table with different data from the same table. Thanks Link to comment https://forums.phpfreaks.com/topic/82735-html-table-refresh/ Share on other sites More sharing options...
phpQuestioner Posted December 22, 2007 Share Posted December 22, 2007 try out this example: <script language="javascript"> function update1() { var cb1 = document.form1.checkbox1.checked; if (cb1 == true) { document.getElementById('info1').innerHTML="Now Some Different Content"; } else if (cb1 != true) { document.getElementById('info1').innerHTML="Page Loaded Content"; } } </script> <table> <td id="info1"> Page Loaded Content </td> </table> <form name="form1"> <input type="checkbox" name="checkbox1" onclick="update1()"> </form> Link to comment https://forums.phpfreaks.com/topic/82735-html-table-refresh/#findComment-420923 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.