Using checkboxes to show/hide fields in a form

    Date: 08/29/07 (Javascript Community)    Keywords: php, java

    I'm relatively new to Javascript and PHP, so if anyone can help me with this I'd really appreciate it.

    I have a nice bit of code which allows me to hide fields, but no matter how I play around with it I can't quite figure out how to make hiding them the default option so that I can click to show them instead. The code is as follows:



    with the following where I want to hide the boxes:

    Instructions 

    STUFF TO HIDE 


    Does anyone have any thoughts on what I could do with this? I've tried altering the script by swapping the two style display lines, with the box automatically checked, but that didn't work - just meant that I had to click twice before it hid the rest of it. The same happened when I tried changing the script to read checked == false instead. Any other suggestions would be great, either for this script or a different way of doing it.

    Thanks in advance.

    Source: http://community.livejournal.com/javascript/139293.html

« Using Javascript to get... || Random Image+ »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home