0

I have a dynamic table which has 2 dynamic rows .i.e students and their subjects and marks. The code is below :

Click here to view the code

Code for Serial Number

 function numberRows() {
      $('input[name^="SNo"]').each(function(i) {
            $(this).val(i + 1);
      });
        }
    numberRows();

Output that comes :

enter image description here

Output expected

enter image description here

The serial numbers are not generated dynamically. Where could I have possibly gone wrong? Would appreciate any help/ suggestions! :)

0

1 Answer 1

1

You are calling function

 numberRows();

after return statement. Either update logic or call it at the after processing return call. Like - https://jsfiddle.net/jqus6bmw/

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a million! :)

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.