March 13, 201313 yr Hi there, I would like a bit of help cracking how to go about looping through multipul textboxes of which are generated via jquery. Example structure. <input type="text" class="textbox1" id="itemcode"/> <input type="text" class="textbox1" id="itemnme"/> <input type="text" class="textbox1" id="itemdesc"/> <input type="text" class="textbox2" id="itemcode"/> <input type="text" class="textbox2" id="itemnme"/> <input type="text" class="textbox2" id="itemdesc"/> <input type="button" id="addbox"/><input type="button" value="submit"/> Jquery button can add new textboxes counting up. I need PHP to loop through the submitted results so that all of textbox1 row go into the mysql table as 1 row, textbox2 as a second row, etc. But, there will be seperate values that need to go into another table at the same time such as itmnme and itmcode but not itmdesc. Any help much appreciated. Sorry if iv not explained this very well. Thanks Edited March 13, 201313 yr by Tex0gen
March 13, 201313 yr Hi there, I would like a bit of help cracking how to go about looping through multipul textboxes of which are generated via jquery. Example structure. <input type="text" class="textbox1" id="itemcode"/> <input type="text" class="textbox1" id="itemnme"/> <input type="text" class="textbox1" id="itemdesc"/> <input type="text" class="textbox2" id="itemcode"/> <input type="text" class="textbox2" id="itemnme"/> <input type="text" class="textbox2" id="itemdesc"/> <input type="button" id="addbox"/><input type="button" value="submit"/> Jquery button can add new textboxes counting up. I need PHP to loop through the submitted results so that all of textbox1 row go into the mysql table as 1 row, textbox2 as a second row, etc. But, there will be seperate values that need to go into another table at the same time such as itmnme and itmcode but not itmdesc. Any help much appreciated. Sorry if iv not explained this very well. Thanks i think u are meaning you want something like this <input type="text" class="textbox1" name="data[]" id="itemcode"/> <input type="text" class="textbox1" id="itemnme"/> <input type="text" class="textbox1" id="itemdesc" name="data[]" /> <input type="text" class="textbox2" id="itemcode" name="data[]" /> <input type="text" class="textbox2" id="itemnme" name="data[]" /> <input type="text" class="textbox2" id="itemdesc" name="data[]" /> <input type="button" id="addbox"/><input type="button" value="submit"/> Notice where it says name="data[]" this will put all submitted values in a array that u can access and loop through a single post request using $_POST['data']; Edited March 13, 201313 yr by webdesigner93
Create an account or sign in to comment