larp.ly
Posts: 0
Joined: Thu May 31, 2012 2:54 pm

Check if checkbox is checked

I need to see if a checkbox is checked.
I have tried a few different ways but am not sure with using the Tiggr API.

Right now I have

var dblRare = Tiggr('dblRare');
if ($('#dblRare').attr('checked'))
{alert("checked");}

Can spomeone please provide some insight on the syntax for this?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Check if checkbox is checked

It should be something like this:
code
var v = $("input[type='checkbox']:first").attr("checked");
alert (v);
/code

As per: http://jquerymobile.com/demos/1.1.0/d...

larp.ly
Posts: 0
Joined: Thu May 31, 2012 2:54 pm

Check if checkbox is checked

Thanks for the quick reply.

I have this now:

var v =$("input#dblRare").attr("checked");
alert (v);

dblRare is part of a mobileCheckBoxGroup1

Would i need to something like
$(input#mobileCheckBoxGroup1.dblRare".attr("checked")

to access it. Even the documentation for jquery doesnt reall seem to cover this,
There are a few different boxes that I need to check for the group.

Thanks again.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Check if checkbox is checked

Try selecting each individual input (check box) and checking its state.

Return to “Issues”