hi
this in javascript does work .. but i wanna do it in jquery and at this moment.
i have a problem to get the id of the radio:checked.//solved i need to put a key and value in each
if there is a better way always welkom
- <tr class="rselect">
- <td>
- <input type="radio" id="carct0" value="33900" name="form[carct]" checked="checked">
- <label for="carct0">Dodge Sport</label>
- </td>
- </tr>
- <tr class="rtw">
-
- <td>
- <input type="radio" id="brw0" value="0.19" name="form[brw]" checked="checked">
- <label for="brw0">Neder</label>
- <input type="radio" id="brw1" value="0" name="form[brw]">
- <label for="brw1">Bui</label>
- </td>
-
- </tr>
- radiogroupLbValue(' carct', ' carct hidden');
- function radiolbValue(param, outPutField)
- {
- _index1 = document.getElementsByName('form['+param+']').length;
- _index2 = document.getElementsByTagName('label').length;
- for(i=0;i<_index1;i++)
- if(document.getElementById(param+i) != null && document.getElementById(param+i).checked)
- for(j=0;j<_index2;j++)
- if(document.getElementsByTagName('label')[j].getAttribute('for') == param+i)
- document.getElementById(''+outPutField+'').value += document.getElementsByTagName('label')[j].innerHTML +", ";
- _index1 = null;
- _index2 = null;
- }
my trai
- var listvalue2 = "";
- jQuery(function(){
- jQuery("#nextbtncheck").click(function(){
- jQuery('input:radio:checked').each(function(i,element){
- listValue2 =jQuery(this).parent("td")
- .children("Label")
- .map(function() {
- //alert(jQuery(this).id);
-
- // for value from label == id from input field in the same tr
- if(jQuery(this).attr("for") == element.id)
- {
- return jQuery(this).html();
- }
- })
- .get();
- });
- });
- });