1

i have a group of check boxes which has same name,it is as follows

one row has

      1.checkbox
      2.text box1
      3.text box2

i want to get the check box value which is selected as well the text boxes values which are in the row that the checkbox exist.

UPDATE :

S.No    Header Name     Size    Display Order
1        checkbox        25          1
2        checkbox        25          2
3        checkbox        25          3
4        checkbox        25          4

This is how my html page looks like, suppose if s.no 1 selected means i want to get the SIZE and DISPLAY ORDER values which are in text box.

this is the code i used but did not even goes in :

function customiseReport()
        {
           alert("customiseReport : ");
           var oParent = document.getElementById('headername');
           var aElements = oParent.getElementsByTagName('input');
           for (var i = 0; i < aElements.length; i++) {
              if (aElements[i].type == 'checkbox' && aElements[i].checked==true) {

              }
           }
        }

how to do this in javascript?

Please help.

Regards

1
  • see my update,this how the html page looks Commented Sep 5, 2012 at 11:05

1 Answer 1

1
    <div id="checkbox_list">
        <input type="checkbox" class="checkboxes"/>
        <input type="checkbox" class="checkboxes"/>
        <input type="checkbox" class="checkboxes"/>
    </div>
    <button id="btn_clickme">Click me</button>
    <script type="text/javascript">
        $(function () {
            $('#btn_clickme').click(function () {
                alert('number of selected checkboxes: ' + $('.checkboxes:checked').size());
            });
        })
    </script>
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the answer, i want the values of selected checkbox as well inputs values of the corresponding checkboxes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.