tapaljor tapaljor - 7 months ago 37
Ajax Question

How to pass value of multiple input form in jQuery ajax?

I have multiple input form. Once I put value and I should able to pass it through jQuery Ajax. It's working on simple html form. But in terms of multi-dimension form I fail.

Please help me get value in jQuery.

I have html form

<form action="index.php" method="POST">
for($a=0; $a<5; $a++) {
echo "<input type='text' name='IdentityID[]' placeholder='GB' onchange=\"getdetail(IdentityID[id]); return false;\"/>";

JQuery ajax

function getdetail(IdentityID) {

alert(IdentityID); //I wan the value to appear here

$.ajax ({
type: "POST",
url: "getdetail.php",
data: { IdentityID: IdentityID},
success: function(data) {
return false;

ReferenceError: IdentityID is not defined


Substitute this.value for IdentityID[id] at onchange=\"getdetail(IdentityID[id])