dwest Posted January 23, 2007 Share Posted January 23, 2007 Javascript novice here.All of this would reside in a PHP form page connected to a database. Other data would be present on the page such as customer info but I've left that out of the conversation since it is handled via PHP.Using javascript, I need to generate new rows for an html table:Assume a combo box, a button, and an html table as below:add standard item (combo box)add custom item (button)(Each of these fields would need to be generated in a textbox so they could be edited.)sku name descr qty price [u]delete[/u]b321 product1 nice product 1 $1.00 checkboxb322 product2 nicer product 1 $2.00 checkboxb323 product3 nicest product 1 $3.00 checkboxThe add standard item combo box would need to be populated from the database "items" table. The sku and name would need to be visible. Upon selecting an item, its data is added to the html table above. Again, with each field being a textbox.The add custom item button would simply add another row to the html table with empty textboxes awaiting entry of the custom data.The delete link (the last column) deletes any rows for which the checkbox is checked.[b]So, my question then is how do I accomplish this???[/b]For clarity, once all items are added to the table, the form is posted to a form handler and the rows are inserted into a database table along with the customer id, and other data collected on the form.Thanks! Quote Link to comment Share on other sites More sharing options...
fenway Posted January 23, 2007 Share Posted January 23, 2007 Well, you can easily write out a new TR... and prepopulating whatever fields you want isn't a problem either. What is you question, exactly, then? Quote Link to comment Share on other sites More sharing options...
dwest Posted January 23, 2007 Author Share Posted January 23, 2007 I don't know javascript. How do I write out the new tr etc.? Quote Link to comment Share on other sites More sharing options...
dwest Posted January 23, 2007 Author Share Posted January 23, 2007 Never mind on this. I think I can just do it all with PHP.Thanks! Quote Link to comment Share on other sites More sharing options...
fenway Posted January 23, 2007 Share Posted January 23, 2007 [quote author=dwest link=topic=123659.msg511350#msg511350 date=1169564859]Never mind on this. I think I can just do it all with PHP.Thanks![/quote]You could, but then you'd have to go round trip all the time. Quote Link to comment 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.