SarahB12 Posted October 9, 2019 Share Posted October 9, 2019 I'm using https://datatables.net/ to display a calendar of information. By default all of the days are displayed (Monday - Sunday) and I have checkboxes to hide specific days. <input type=\"checkbox\" checked onclick=\"toggle('.Monday', this)\" > This works well, but I'd like to change the functionality so that all of the checkboxes are unchecked initially and when a user selects a specific day all of the other days are hidden. So, if Monday is checked all of the other days of the week are hidden. Sorry if this is a rudimentary question, I'm a novice and can't seem to find the answer. Quote Link to comment https://forums.phpfreaks.com/topic/309351-hide-all-columns-using-datatables/ Share on other sites More sharing options...
requinix Posted October 10, 2019 Share Posted October 10, 2019 God, I hate DataTables. I don't recognize toggle(). Where is that function coming from? Because that would be what you modify. Quote Link to comment https://forums.phpfreaks.com/topic/309351-hide-all-columns-using-datatables/#findComment-1570483 Share on other sites More sharing options...
cyberRobot Posted October 10, 2019 Share Posted October 10, 2019 14 hours ago, SarahB12 said: ...so that all of the checkboxes are unchecked initially... Which option does the page check initially? Is it Monday? If so, try removing "checked" from the <input> tag you posted above. <input type=\"checkbox\" onclick=\"toggle('.Monday', this)\" > Quote Link to comment https://forums.phpfreaks.com/topic/309351-hide-all-columns-using-datatables/#findComment-1570485 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.