You are viewing limited content. For full access, please sign in.

Question

Question

Pre-Populate Set Number of Table Row Column Values

asked on May 13, 2015

I think this is any easy one, just not sure how to do it. I am working on a form that will have a table. The table will have exactly 10 rows. I need to be able to populate the values of the first column for each row. Here is what it looks like.

I need to be able to enter a distinct value for the products column in each row. I'm hoping there is an easy way to do this using jQuery?

0 0

Answer

SELECTED ANSWER
replied on May 13, 2015

You can use something like

$(document).ready(function () {
  $('[name="Field1(1)"]').val("Product 1");
  $('[name="Field1(2)"]').val("Product 2");
  $('[name="Field1(3)"]').val("Product 3");
  $('[name="Field1(4)"]').val("Product 4");
  $('[name="Field1(5)"]').val("Product 5");
  $('[name="Field1(6)"]').val("Product 6");
  $('[name="Field1(7)"]').val("Product 7");
  $('[name="Field1(8)"]').val("Product 8");
  $('[name="Field1(9)"]').val("Product 9");
  $('[name="Field1(10)"]').val("Product 10");
});

A web inspector like the one built into Firefox can help you confirm the field name.

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.