nkjackson 2 Posted April 5, 2018 Report Share Posted April 5, 2018 (edited) I want to check / uncheck child checkboxes when the parent checkbox is checked / unchecked. I have the html and javascript worked out and it works fine in a browser and in ubot. However it stops working in ubot when the variable and fillwith parameters are added to the <input> tag. Is this a bug? If not, what change do I need to make to get this to function as intended? Code is below as well as a sample bot is attached. Thanks in advanceui html panel("<!DOCTYPE html><html><head><title> How to select all child checkboxes using jQuery </title></head><body><ul><li><input type=\"checkbox\" variable=\"#With Variable\" fillwith=\"checked\" /> With Variable<ul><li> <input type=\"checkbox\" variable=\"#This Not Work\" fillwith=\"checked\" /> This Does Not Work </li></ul></li><li> <input type=\'checkbox\' />Without Variable<ul><li> <input type=\'checkbox\' /> These</li><li> <input type=\'checkbox\' /> Children<ul><li> <input type=\'checkbox\' /> Are All </li><li> <input type=\'checkbox\' /> Working </li><li> <input type=\'checkbox\' /> Properly </li></ul></li></ul></li></ul></body><script src=\"http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js\"></script><script>// jQuery Code starts from here$(function () \{$(\"input[type=\'checkbox\']\").click(function () \{$(this).siblings(\'ul\').find(\"input[type=\'checkbox\']\").prop(\'checked\', this.checked);\});\});</script></html>",300)CheckboxTest.ubot Edited April 8, 2018 by nkjackson Quote Link to post Share on other sites
cүвεя_נυηкιε 68 Posted April 9, 2018 Report Share Posted April 9, 2018 Hey nkjackson, I had a similar problem to this a few months back with glitchy or just not working checkboxes, .. The fix for me was simply moving the javascript to a different location (after hous of checking, double and triple chcking lol). Try moving the code between the <script> tags to above the </body> tag, .. if that doesnt work try placing it in and/or below the <header> tags, you should find a sweet spot. CheersCJ 1 Quote Link to post Share on other sites
nkjackson 2 Posted April 13, 2018 Author Report Share Posted April 13, 2018 Thanks CJ will try 1 Quote Link to post Share on other sites
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.