Link to home
Start Free TrialLog in
Avatar of Dinesh Kumar
Dinesh KumarFlag for India

asked on

jquery issue with radio buttons

Hi I want to do the work which is done on radio button click  in button(named Button1) click, kept blank below, Please help

 <script type="text/javascript">

         $(document).ready(function () {
             $(".myRadios").bind("click", function () {          

                 alert($(this).val());
           
                 alert($(this).closest("td").next("td").html());
                 alert($(this).closest("td").next("td").next("td").html());
             });

            $(".btncss").bind("click", function () {

             });
       });

     </script>
     <div id="abc">
         <br />
         <br />
         <table id="tbl">
             <tr>
                 <td>
                     <input class="myRadios" name="abc1" id="abc1" type="radio" value="1" /></td>
                 <td>11</td>
                 <%--<td>22</td>--%>
             </tr>
             <tr>
                 <td>
                     <input class="myRadios" name="abc1" id="abc1" type="radio" value="2" /></td>
                 <td>22</td>
                 <td>33</td>
             </tr>
             <tr>
                 <td>
                     <input class="myRadios" name="abc1" id="abc1" type="radio" value="3" /></td>
                 <td>33</td>
                 <td>44</td>
             </tr>
             <tr>
                 <td>
                     <input class="myRadios" name="abc1" id="abc1" type="radio" value="4" /></td>
                 <td>44</td>
                 <td>55</td>
             </tr>
         </table>
         <input id="Button1" type="button" value="button" class="btncss" />
     </div>

Open in new window

Avatar of Gary
Gary
Flag of Ireland image

If I understand just disable the button in the onclick function

$("#Button1").attr("disabled",true)
Avatar of Dinesh Kumar

ASKER

the problem is that whenever I click on Button1

I will check if radio button is selected then I want to pick values from corresponding two <td>s

e.g if I select second radio button and then press the Button1 then corresponding td are  <td>22</td>                <td>33</td> I should be able to get those values.
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much!!
It worked like a bolt :)