Add more Input box using javascript

function addvalue(){ var products=””; var i=$(“#tblproduct tr”).size(); var j=0; var str=””; var k=0; for(j=1;j<=i;j++) { proval=""; proqty=""; if($("#txtpro"+j).val()!='0' && $("#qty"+j).val()!='') { str+="&pro"+j+"="+$("#txtpro"+j).val()+"&qty"+j+"="+$("#qty"+j).val(); k++; } } alert(str); /* $.ajax({ type: 'POST', url: "data.php?id="+i+'&str='+str, data: {}, success: function(data){ alert(data); } }); */ } function btnclickadd() { var i = $('#tblproduct tr').size() +1; $(".addmore").hide(); $('#myid').val(i); var x="”; x=x.replace(‘txtpro1’,’txtpro’+i).replace(‘txtpro1’,’txtpro’+i); $(‘

Product: ‘+x+’ Quantity: Add More

‘).appendTo(‘#tblproduct’); return false; }

Product: Quantity: Add More
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s