I have many textboxes which are dynamically added through jQuery. they all have same name like…
<input type="text" name="employer" id="employer" />
<input type="text" name="position" id="position" />
<input type="text" name="city" id="city" />
<input type="text" name="employer" id="employer" />
<input type="text" name="position" id="position" />
<input type="text" name="city" id="city" />
so many...
I am passing all textbox value through AJAX, but its not working. my AJAX code is below..
AJAX
$.ajax(
{
type: "POST",
url: $("#cfgRoot").val()+'/accounts/educationInfoPost.php',
data:
{
employer:$("#employer").val().trim(),
position:$("#position").val().trim(),
city:$("#city").val().trim()
}
});
Thanks in Advance
And pass it into ajax data.
Code
And one more thing DO NOT ADD SAME ID FOR DOM.
ID MUST BE UNIQUE FOR EACH DOM