I have a standard jquery ajax function like so
$.ajax({
type: "POST",
url: "/myApp/InsertRecord.action",
data: {
table:table,
issueNumber:issue_number,
resultPointer:result_pointer
},
success: function(data) {
$("#GRID_DIV").html(data);
}
});
If I were to have a dynamic number of additional parameters with dynamic names, would it still be possible to use the jquery ajax function?
To show what I am doing, in a standard .submit() scenario, I would grab the data like so:
public MyAction extends ActionSupport implements ParameterAware, SessionAware, ServletContextAware {
private Map<String, String[]> parameters;
.
.
.
Set<String> keySet = parameters.keySet();
EDIT:
To create an array, I can do this to get all the relevant names in my form:
var allNames=new Array();
var numberOfRecords = 0;
$('input:text[name^=rec_]').each(function() {
allNames[numberOfRecords++] = $(this).attr('name');
});
because I know that all the dynamic names will at least start with rec_ but then the problem with this is I do not have specific getters/setters for each field because I don't know what their full names will be.