I am looking to find a way of creating a table in a div from the information submitted by the user in a form. The table would have a fixed number of columns, but a variable number of rows.
Would I be able to do this directly, or would the information need to be added to a mySQL database and then the table would be filled from the database on page reload?
开发者_JAVA百科Any information as to my options here would be helpful.
As far as I know JavaScript is meant to be client side therefore cannot directly help you with things you want to do on your server ! I dont know what platform you are using , but regardless, you need to have a serve-side code(e.g PHP, ASP, JSP ...) to make a db connection and create the table for you and optionally redirect to the same page or another. Basically it does not require any use of javascript code, except if you want to perform the action without reloading the page, In that case you need to use AJAX an I would suggest you to use jQuery AJAX functions.
精彩评论