|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have a cold fusion form and I would like 2 fields (DockingStation and DockingStationQuantity) to appear when the field Laptop is checked. There are other fields that I have on the form so I would not want to hide all the fields on the form when it loads, just those 2. Thanks in advance for all your help. |
|
#2
|
|||
|
|||
|
This is a Javascript/DHTML question. I'm not sure what the answer is (I personally think that suddenly hiding and showing form fields to the user is bad usability), but if you search the web for info on hiding and showing DHTML layers you should find an answer.
|
|
#3
|
|||
|
|||
|
JavaScript Function is the answer
If you want to hide stuff on a Web page until the user clicks on something, then you are going to use the block/none display with a <DIV>.
Here is the code: <html> <head> <script language="JavaScript"> //written by support@ColdFusionCart.com //get all your E-commerce done there! function OnOrOff(object) { // expand or contract document.getElementById(object).style.display = (document.getElementById(object).style.display == 'block') ? 'none' : 'block'; cvalue = (document.getElementById(object).style.display == 'block') ? 1 : 2; } </script> </head> <body> <p>This is my page. When you click this <a href="#" onClick="OnOrOff('myArea');">button</a>, it will switch between hiding/displaying an area on this page from the user below. Keep clicking and it will keep switching between hidden and displayed. <div style="display: none;" id="myArea"> <p>Can you see me???? </div> </body> </html> Marc Software Engineer support@ColdFusionCart.com Cold Fusion Shopping Cart |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Show fields when another field is checked |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|