Submit Your Article Forum Rules

Results 1 to 3 of 3

Thread: Show/Hide HTML Content

  1. #1
    Junior Member
    Join Date
    Jul 2003
    Posts
    18

    Show/Hide HTML Content

    Hello

    I have a cold fusion form and would like to be able to show/hide a particular section of it through either a simple link or radio buttons.

    The user fills in their contact address details and billing address. If the billing address is different from contact I would like them to click the link for the billing address fields to appear.

    Look forward to hearing from you.

    Regards
    Susie

  2. #2
    Senior Member mysticlighthouse's Avatar
    Join Date
    Jul 2003
    Posts
    100

    Hiding Content

    You can use stylesheets and javascript to do this client side.

    Let's say the element that contains the information you are wanting has id="billAdd". Have a link call a javascript function.

    Code:
    function changeStyle(){
    	target = document.getElementById("billAdd");
    	if(target.style.display=="none"){
    		target.style.display="block";
    	} else {
    		target.style.display="none";
    	}
    }
    That should display it and hide it for you.

    If you want to do it server side you could have a check box and once the form is submitted, ColdFusion could check to see if that Form element was passed and then redisplay the page with all the information and now the billing address shown by cfif... you might want to incorporate this approach just to catch anyone who might have had javascript turned off.
    Bryan DeNosky

  3. #3
    Junior Member
    Join Date
    Aug 2003
    Posts
    28

    Re: Hiding Content

    I'm use stylesheets and javascript like this:
    Code:
    function showhide(aa) {
    	aa.className = (aa.className == 'layshow') ? 'layhide' : 'layshow';
    }
    <-- AlexBel -->

Similar Threads

  1. How to hide website content?
    By sck4784 in forum Search Engine Optimization Forum
    Replies: 3
    Last Post: 02-21-2009, 02:59 AM
  2. show/Hide Divs leaves massive white space in FF
    By trancehead in forum Graphics & Design Discussion Forum
    Replies: 3
    Last Post: 11-06-2007, 06:49 AM
  3. Show Hide Layer Flickering Problem
    By Kane in forum Graphics & Design Discussion Forum
    Replies: 6
    Last Post: 03-16-2007, 11:24 PM
  4. JS Hide/Show function not working in NS
    By lahddah in forum Web Programming Discussion Forum
    Replies: 1
    Last Post: 08-03-2004, 03:04 PM
  5. Show Hide Layers in Netscape
    By nancyj in forum Web Programming Discussion Forum
    Replies: 13
    Last Post: 02-24-2004, 03:17 AM

Posting Permissions

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