I am working on a Catalyst database project and am trying to execute some AJAX requests through jQuery. Parameters are sent OK, as seen in image 1.

Note that both the "diagnosis" and the "type_consents" (and their corresponding dates) are sent as an array of values (value 1, value 2, ... value n).
Now for server-side processing Catalyst::Requestit makes it easy to retrieve data through $req->parameters, but it seems to work for me.
I do it like this:
my $params = $c->request->parameters;
my @type_consents = $params->{type_consent};
my @date_consents = $params->{date_consent};
my @diagnosis = $params->{diagnosis};
my @date_diagnosis = $params->{date_diagnosis};
Then I need to encode these arrays and insert for each pair of values (diagnosis|date , consent|date). In addition, I need to store and process all transactions and execute them all at once in a block eval(), so I do it as follows:
my %transactions;
my $diag_index = 0;
foreach my $key ( 0 .. $#diagnosis ) {
$transactions{diagnosis}{$diag_index} = $diagnosis_mod->new(
{
subject_id => $subject_id,
diagnosis_date => $date_diagnosis[$key],
diagnosis => $diagnosis[$key],
diagnosis_comment => "",
suggested_treatment => ""
}
);
print STDERR "\n" . $date_diagnosis[$diag_index];
print STDERR "\n DEBUG: $date_diagnosis[$diag_index] | $diagnosis[$diag_index] | key: $diag_index";
print STDERR "\n DEBUG2:" . Dumper( @date_diagnosis ) . " | " . Dumper( @diagnosis );
$diag_index++;
}
:

, "" - ? , .