WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-04-2003, 11:32 AM
WebProWorld Member
 

Join Date: Jul 2003
Posts: 39
SusieG RepRank 0
Default 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
Reply With Quote
  #2 (permalink)  
Old 12-04-2003, 03:43 PM
mysticlighthouse's Avatar
WebProWorld Pro
 

Join Date: Jul 2003
Location: Louisville, KY
Posts: 186
mysticlighthouse RepRank 0
Default 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
Reply With Quote
  #3 (permalink)  
Old 12-05-2003, 10:04 AM
WebProWorld Member
 

Join Date: Aug 2003
Location: Canada
Posts: 30
AlexBel RepRank 0
Default Re: Hiding Content

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

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0