Okay so I'm using the SUPERSIMPLE code to check my checkboxes. I have an invisible ahref over my elements and a checkbox next to them. Here's the html:
<a href="#" class="transparent-checkbox-thingy" id="<?php echo $id;?>" onclick="check(<?php echo $id;?>)"></a>
<input type="checkbox" value="<?php echo $id;?>" name="users[]" class="newconvo-check" id="<?php echo $id;?>">
So I've tried using this method, where my check() function and input tags have the same id, using the following JQ:
function check(id)
{
var newid = '#'+id;
$(newid).prop('checked', true);
};
or this one
function check(id)
{
$('#' + id).prop('checked', true);
};
or this one
function check(id)
{
$(id).prop('checked', true);
};
None of them work. They return valid info on alert(id) or alert(newid) but they don't check the damned checkbox. So I tried this one:
$(document).ready(function() {
$("a.transparent-checkbox-thingy").click(function(event) {
event.preventDefault();
var thisid = ('#' + event.target.id);
$(thisid).prop('checked', true);
});
});
Didn't work. So I tried this
$(document).ready(function() {
$("a.transparent-checkbox-thingy").click(function(event) {
event.preventDefault();
$('#1').prop('checked', true);
});
});
Didn't work. Yes, there is <input type="checkbox"> with id="1" always. And that's the one I'm testing. And yes, I have this
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
src. Got it fixed, but thanks!