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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing number of fields in a form?

    Everyone and anyone. I'm not a programmer so please forgive the crap way I have achieved this so far....

    I'm currently working on a "spot the ball" page for a friend and have a working script that will enable you to have 5 seperate guesses which in turn will return the x and y coordinates of each guess to a form

    see www.stenicol.com

    to see the php code goto www.stenicol.com/test (I have renamed the files to a .phps format)

    What I would like to do is instead of having 5 guesses by default is to have the option of being asked how many guesses you would like to enter, and then depending on the answer, updating the form automatically to indicate the relevant number of guesses.

    I'm sure this will involve completelt re-writing the whole setup but haven't a clue how to accomplish it.

    Can anyone throw so light my way?

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why don't you let PHP do the walking on this one? First page, prompt the user for the number of guesses they would like, then use that value (you could register it as part of the session) to create the appropriate number of elements on the form page. MUCH better than any javascript solution (although it CAN be done with JS)
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Ames, IA, USA
    Posts
    373
    Thanks
    0
    Thanked 0 Times in 0 Posts
    A JS solution would be something along the lines of dynamically changing the element.style.display value from none to inline or the element.style.visibility value from hidden to visible -- not all that tough.

    Unfortunately, I don't have the time to write up the code right now ...
    Need more emoticons?
    Visit Catman's Private Stock


  •  

    Posting Permissions

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