treehouse : what would you like to learn today?
Web Design Web Development iOS Development

how to create dynamic text boxes in php

  • hi all

    how to create dynamic text boxes in php

    when i click add button it's create new textbox when i finish adding what ever number of textboxes i get the value of them and insert them into database
  • PHP runs on the server. Functionality like this is something that happens while a visitor is using the webpage; i.e., on their own computer. PHP is over and done with at that point. You should look at a javascript solution.
  • thanx traq could you help me in this i tried but i confused !
  • for example, if you're using the jQuery library, you might do something like this.

    Once the form is submitted, all of the textareas will be available to your PHP script as an array.
  • yes this is what i need thank you ,
    but how to get all the values from this form and insert it to mysql database
  • <textarea name='textbox[]'></textarea>


    seems familiar right?

    try to print_r($_POST['textbox']) , you will get a set of array to process