Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2003
    Posts
    603
    Thanks
    2
    Thanked 1 Time in 1 Post

    auto-create more textboxes?

    is there a way to automatically have a certain amount of textboxes appear in a form based on a set number in the previous page? i have an admin panel that you can add an album to the database, and i have a dropdown menu where you can select that there are 1-25 tracks on the album you are adding... but i want it so when you click Continue, it shows that many textboxes for titles of the tracks... but i dont want to make all 25 fields 25 times in html

  • #2
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Just use a loop, --

    PHP Code:
    for ( $i 0$i $numItems$i++ ) {
      
      
    $textBoxes .= "<input type=\"text\" name=\"text$i\"/>\n";


    Or at least something along those lines. ..
    Omnis mico antequam dominus Spookster!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •