tags:

views:

46

answers:

2

I have created a table and the values are filled in by the user. The user can create new rows.

How can I get the values of the table and send it to my controller using jquery or any other method?

Please give me an example.

A: 

First of all you should give a properly names for your inputs, and than you can whether post a form or make asynchronous get using jQuery.getJSON()

Сергій
A: 

create a class for your cells like class="AnswerCell" and then get the array from jquery like this:

val myanswers = $.(".AnswerCell");

Then do your post like this:

$.post("myActionMethod", {answers: myanswers});

and the actionmethod should look like this:

public ActionMethod myActionMethod(String[] answers)
{
//do something
}

Hope this helps.

Al Katawazi