0

Just having a start with JQuery, I have a webform where there is a

  1. Drop down list with numbers numbers 1,2,3 as items
  2. A gridview on the form (with text boxes on each row for taking inputs)
  3. If user selects 2 in dropdown list, 2 rows get added to the gridview with a textbox on each row

Currently I'm doing this with UpdatePanel & gridview server side. How do I do this with JQuery ?

Should I skip the gridview altogether and just drop a table on my webform & add rows to it via JQuery ?

How would I add the server side textboxes on each row ? Is there an easy alternate.

Thank you, Damien.

1 Answer 1

1

have a look at .append and appendTo

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

5 Comments

I am trying prepend on an empty gridview initially but it does not work. Can you give a little hint ?
$('#btnTest').click(function(){ $('#<%=myGridView.ClientID%>').append("<tr>New row</tr>"); });
place your code inside $(document).ready(function(){//your code here});
Thanks Enigma my code is already inside document.ready function but it won't work.
The code works when there is a row in the gridview but not on a zero rows.

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.