javascript - How to get the value of these created textboxes? -
whenever clicking on "add textbox" button create new +1("multiple") html textbox jquery's append method not logic value in php.
$(w).append('<div><input type="text" name=/><a href="#" id="removes">remove</a><br/></div>');
suppose if create 5 new textboxes how assign them name not create problem when value php & store in database.
try way:
$(w).append('<div><input type="text" name="textboxname[]"/><a href="#" id="removes">remove</a><br/></div>'); ^^^ add name
and have value in php this:
suppose using post
method:
$fisrt = $_post['textboxname'][0]; $second = $_post['textboxname'][1];
or can use foreach
loop this:
foreach($_post['textboxname'] $values){ //you logic }
Comments
Post a Comment