Forms and div toggle

  • Started
  • Last post
  • 2 Responses
  • Point5

    OK, so I've got a pretty lengthy form that I've put togther and I've implemented some javascript a friend gave me to have certain radio buttons show/hide certain divs... and now I kind of have 2 problems:

    1. the script I got basically says "Show this 'xID', if not, show 'zID'. I really don't want to show either this ID or that ID, I just want to toggle one ID visibility, so it either shows or is hidden.; so my current hack at the moment is just to have an empty div container as the alternate ID that shows up it the other one isn't selected. Javascript isn't really my cup of tea, so I really don't know how to change this

    2. the toggles do actually work, however, I'm having problems with the array IDs that are nested within another array ID; when I click the nested IDs, they affect the behavior of the ID that they are contained in and close it. I've combed the code about 30 times and I can't see how that would be affecting it; what am I missing? Is this some java behavior shit?

    Here's the form: http://insideoutlines.com/forms/…

    Help would be much appreciated...

  • acescence0

    actually what the script appears to do is hide ALL of the divs in the array, then show the requested one

    hideallids loops and calls hidediv in each iteration. you could just call hidediv and pass the id you want to hide without hiding others.

    you can also just call showdiv and pass the id to show a div without hiding anything else

    hope that helps

  • Point50

    OK acescence, I will dig through the script and see if I can give that a try. Thank you very much for clearing up what it is doing exactly, because obviously I really didn't understand what it was saying.