I have a php-based form with radio-buttons with following labels - I've been trying to get the text-value of these labels, but I keep getting empty variables - it seems it doesn't pick up the value at all.
Here's some of the code:
- <li><span class="radioinput"><input class="crirHiddenJS" id="this_pulje_<?php echo $pulje['pv_ID']; ?>" type="radio" name="<?php echo $pulje['p_subname']; ?>" value="<?php echo $pulje['pv_ID']; ?>"></span><label for="this_pulje_<?php echo $pulje['pv_ID']; ?>"><strong><?php echo $gametype; ?>, M: </strong><?php echo $pulje['pv_module']." <strong>S: </strong>".$pulje['pv_system']." <strong>GM: </strong>".$pulje['pv_GM']; ?></label></li>
which outputs something like this:
- <li><span class="radioinput"><input type="radio" value="47" name="pulje_2" id="this_pulje_47" class="crirHidden"></span><label for="this_pulje_47" class="radio_unchecked"><strong>R, M: </strong>Bergen 2192 <strong>S: </strong>Blue Planet v2 <strong>GM: </strong>Thor André Karstensen</label></li>
And then I have the following jQuerycode, which doesn't return anything:
- var radioContent = $("#"+prevTarget+" :radio:checked").next('label').text();
As for the "prevTarget" it's being populated, because if I change the above to this:
- var radioContent = $("#"+prevTarget+" :radio:checked").val();
it returns the value just fine. But for some reason it doesn't return the text from the label - and I don't really understand why.
If anyone wants to take a look at the test-page, it's found here:
http://www.regncon.no/test.php