imperium2335 Posted October 27, 2010 Share Posted October 27, 2010 Hi, I have made something where the user can add more form fields. Newly added fields aren't being processed by php at all, any idea why? :'( Here is my function for adding a new row of fields... function addPart(divName){ var newdiv = document.createElement('div') ; newdiv.setAttribute('id', 'partrow' + counter) ; newdiv.style.clear = 'both' ; newdiv.innerHTML = "<div style='clear:both;'><div style='float:left;width:40px;text-align:center;margin:5px 5px 0px 0px;'>\r<input onkeyup=\"advCalc('" + counter + "')\" id='quantity" + counter + "' name='quantity" + counter + "' type='text' value='1' size='1'\/>\r<\/div>\r<div style='float:left;width:100px;text-align:left;margin:5px 0px 0px 0px;'>\r<input id='manufacturer" + counter + "' name='manufacturer" + counter + "' type='text' value='' size='9'\/>\r<\/div>\r<div style='float:left;width:95px;text-align:left;margin:5px 5px 0px 0px;'>\r<input id='partnumber" + counter + "' name='partnumber" + counter + "' type='text' value='' size='9'/>\r</div>\r<div style='float:left;width:80px;text-align:left;margin:5px 5px 0px 0px;'>\r<input id='supplier" + counter + "' name='supplier" + counter + "' type='text' value='' size='4'/>\r</div>\r<div style='float:left;width:100px;text-align:left;margin:5px 5px 0px 0px;'>\r<input id='type" + counter + "' name='type" + counter + "' type='text' value='' size='6'/>\r</div>\r<div style='float:left;width:85px;text-align:left;margin:5px 5px 0px 0px;'>\r<input id='deliverytime" + counter + "' name='deliverytime" + counter + "' type='text' value='' size='13'/>\r</div>\r<div style='float:left;width:40px;text-align:left;margin:5px 0px 0px 45px;'>\r<select id='supplyCurrency" + counter + "' name='supplyCurrency" + counter + "'>\r<option value='pound' selected='selected'>£</option><option value='dol'>$</option><option value='euro'>€</option></select>\r</div>\r<div style='float:left;width:15px;text-align:left;margin:5px 5px 0px 0px;'>\r<input onkeyup=\"advCalc(\'" + counter + "\')\" id='supplyamount" + counter + "' name='supplyamount" + counter + "' type='text' value='' size='3'/>\r</div>\r<div style='float:left;width:40px;text-align:left;margin:5px 0px 0px 45px;'>\r<select name='provideCurrency" + counter + "' id='provideCurrency" + counter + "'><option value='pound' selected='selected'>£</option><option value='dol'>$</option><option value='euro'>€</option></select>\r</div>\r<div style='float:left;width:15px;text-align:left;margin:5px 5px 0px 0px;'>\r<input onkeyup=\"advCalc(\'" + counter + "\') id='provideamount" + counter + "' name='provideamount" + counter + "' type='text' value='' size='3'/>\r</div>\r<div style='float:left;width:20px;text-align:left;margin:5px 0px 0px 45px;'>\r<strong>£</strong>\r</div>\r<div style='float:left;width:40px;text-align:left;margin:5px 5px 0px 0px;'><span id='total" + counter + "'></span></div> \r" ; document.getElementById(divName).appendChild(newdiv) ; counter++ ; } Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/216967-php-wont-process-newly-added-form-fields/ Share on other sites More sharing options...
trq Posted October 27, 2010 Share Posted October 27, 2010 You'll need to post your PHP code in the PHP Help forum. You should really look into moving your css out of your markup as well. Quote Link to comment https://forums.phpfreaks.com/topic/216967-php-wont-process-newly-added-form-fields/#findComment-1127046 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.