|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi everyone,
I've got a form that consists of 3 parts. The first part has all the fields for the billing address, the second is for the delivery address, and the third is for the username and password etc. I wanted the second section about the delivery address to be hidden and for there to be a message saying: "Please "tick" if your Delivery Address is different from your Billing Address." I wanted a tick box and then if the box is ticked then the information about the delivery address is revealed. Can someone tell me if this involves javascript as well as css to handle this, and if so can you tell me what the code would be like? Appreciate any offered. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Like this?
<script type="text/javascript"> <!-- function show(elementID) { var myElement = document.getElementById(elementID); if (myElement) myElement.style.display = "block"; } //--> </script> <input type="checkbox" name="delivery" id="delivery" onclick="show('myDiv')" /> <div id="myDiv" style="display:none"> <input type="text" name="DeliveryAddress" id="DeliveryAddress" /> </div> Or like this: <input type="checkbox" name="delivery" id="delivery" onclick="document.getElementById('myDiv').style.di splay='block';" /> <div id="myDiv" style="display:none"> <input type="text" name="DeliveryAddress" id="DeliveryAddress" /> </div> -- Ken Ford Adobe Community Expert - Dreamweaver Fordwebs, LLC http://www.fordwebs.com "gwhPoster" <webforumsuser@macromedia.com> wrote in message news:fprk4a$os8$1@forums.macromedia.com... > Hi everyone, > > I've got a form that consists of 3 parts. The first part has all the > fields > for the billing address, the second is for the delivery address, and the > third > is for the username and password etc. I wanted the second section about > the > delivery address to be hidden and for there to be a message saying: > > "Please "tick" if your Delivery Address is different from your Billing > Address." > > I wanted a tick box and then if the box is ticked then the information > about > the delivery address is revealed. > > Can someone tell me if this involves javascript as well as css to handle > this, > and if so can you tell me what the code would be like? > > Appreciate any offered. > > > |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Thanks so much for the code. The first example worked really well. When the box
is ticked the element expands to show the delivery fields - the only problem is that when you try to untick it, the element doesn't collapse again. Is it hard to do this, ie. is there much more code to add? |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
<script type="text/javascript">
<!-- function show(elementID) { var myElement = document.getElementById(elementID); if (myElement.style.display == "none") { myElement.style.display = "block"; } else { myElement.style.display = "none"; } } //--> </script> <input type="checkbox" name="delivery" id="delivery" onclick="show('myDiv')" /> <div id="myDiv" style="display:none"> <input type="text" name="DeliveryAddress" id="DeliveryAddress" /> </div> -- Ken Ford Adobe Community Expert - Dreamweaver Fordwebs, LLC http://www.fordwebs.com "gwhPoster" <webforumsuser@macromedia.com> wrote in message news:fps33h$a6v$1@forums.macromedia.com... > Thanks so much for the code. The first example worked really well. When > the box > is ticked the element expands to show the delivery fields - the only > problem is > that when you try to untick it, the element doesn't collapse again. Is it > hard > to do this, ie. is there much more code to add? > |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Thanks again - works perfectly now.
By the way, can you tell me if that big image in the background of this forum's page, ie. the grey image, is just one big image that they've put in the body tag? Wasn't sure because I thought that images needed to be cut into smaller files for easier download. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
One file.
You don't need to break up images. -- Ken Ford Adobe Community Expert - Dreamweaver Fordwebs, LLC http://www.fordwebs.com "gwhPoster" <webforumsuser@macromedia.com> wrote in message news:fps79e$ede$1@forums.macromedia.com... > Thanks again - works perfectly now. > > By the way, can you tell me if that big image in the background of this > forum's page, ie. the grey image, is just one big image that they've put > in the > body tag? Wasn't sure because I thought that images needed to be cut into > smaller files for easier download. > |
|
![]() |
| Outils de la discussion | |
|
|