0
<?php
$qry=mysql_query("INSERT INTO ingredients(item,quantity,unm)VALUES('$items','$quantitys','$unm')", $con);//edited
?>

<script>
$(document).ready(function(e){

    //variables
    var html = '<p/><div>item: <input type="text" name="item" id="childitem"/>quantity: <input type="text" name="quantity" id="childquantity"/><a href="#" id="remove"> X </a></div>';
    var maxrows = 25;
    var x = 1; 

    //add rows to the form
    $("#add").click(function(e){
        if(x <= maxrows){
        $("#container").append(html);
            x++;
        }
    });

    //remove rows 
    $("#container").on('click','#remove',function(e){
        $(this).parent('div').remove();
        x--;
    });
});
</script>
krlzlx
  • 5,752
  • 14
  • 47
  • 55

0 Answers0