jquery - how to get value of checked element in for loop -
I am working to get every value of the checked element and post it on php. But it only receives the first value of a checked item. Click
here
$ ("# conf") (function () {var count = $ ("Input: checked"). For length; = 0; i & lt; count; i ++) {a = $ ("Input: checked"). Val (); $ .post ("reqs.php? Act = confirm", {id: a} $ ('.qqqqqqqqqqqqqqqqq') .net ("background color:" #fbc 7c7 "}," sharp "). ({Fuzzy: "Hide"}, "slow");}});
and HTML
& lt ;? Php while ($ info = mysql_fetch_assoc ($ result)) {? & Gt; & Lt; Tr class = "req" & gt; & Lt; Td style = "width: 29px" & gt; & Lt; Input name = "confirm" type = "checkbox" id = "& lt ;? php echo $ info ['id'] ;; & gt; Value = "& lt ;? php $ info ['id'] ;? & gt; / & gt; & lt; / td & gt; & lt; td style =" width: 70px "square =" style5 "& Gt; & lt ;? php echo $ info ['email'];? & Gt; & lt; / td & gt; & lt; td style = "width: 72px" square = "style5"> & lt; ; Php eko $ info ['name'];? & Gt; & lt; / td & gt; & lt; td style = "width: 88px" square = "style5" & gt; & lt ;? php echo $ Info ['username'];? Gt; & lt; / td & gt; & lt; td style = "width: 76px" class = "style5" & gt; & lt ;? php eko $ info [' Country & # 39; & gt; & lt; / td & gt; & lt; td style = "width: 76px" class = "style5">
php eko $ info ['radio'] ;? & Gt; & lt; / TD & gt; & lt; / tr & gt; & lt ;? php}? & Gt;
text "itemprop =" text "> change
a = $ ("Input: checked"). Val ();
to
a = $ ("Input: checked"). Eq (i) .val ();
This will receive the price for each subsequent item.
And Use firebug! :)
Comments
Post a Comment