01-21-2010 06:26 PM - edited 01-21-2010 06:28 PM
I am trying to check and uncheck an <input type="checkbox" /> by adding and removing the checked="checked" attribute using javascript (jQuery). Doesn't work; nothing happens. It does work fine in desktop browsers, though. Adding and removing disabled="disabled" works perfectly. I've seen other posts about this on the internet, but no answers.
I'm writing in XHTML 1.0 Strict, hence the checked="checked", but I tried switching everything around to HTML 4.1 and just using checked with no equals sign or value, and it still didn't work.
I'm working on Eclipse with the BlackBerry Simulator 4.6.0.200904091609-212.
Any ideas? Thanks.
Solved! Go to Solution.
01-21-2010 07:37 PM
Have you tried setting "mycheckboxelement.checked = true"? For form input elements there's a difference between the default value (which is what you're modifying with the HTML attribute checked) and the live DOM value (which is what you're modifying with .checked).
01-26-2010 11:46 AM
It works, but I had to do it this way:
document.myform.thecheckbox.checked = false;
thanks!