X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Show additional fields at customer checkout only if a checked box is checked (https://forum.x-cart.com/showthread.php?t=63264)

chris.ath 04-12-2012 12:14 AM

Show additional fields at customer checkout only if a checked box is checked
 
Hello,

I would like to show the additional fields at customer checkout only if a new checked box is checked ( like Ship to a different address).

Can some one help me please?

chris.ath 04-13-2012 09:54 AM

Re: Show additional fields at customer checkout only if a checked box is checked
 
I need something like this


http://i44.tinypic.com/1zxbazn.jpg

cflsystems 04-13-2012 10:07 AM

Re: Show additional fields at customer checkout only if a checked box is checked
 
Look at how "ship to..." is done and replicate it or you can also use jQuery toggle to show/hide a div

chris.ath 04-13-2012 10:16 AM

Re: Show additional fields at customer checkout only if a checked box is checked
 
Quote:

Originally Posted by cflsystems
Look at how "ship to..." is done and replicate it or you can also use jQuery toggle to show/hide a div

Hi Steve,

Thanks a lot for your reply, but i can't until now make this works. Can you please help a little bit more.

Thanks in advance,
Chris

cherie 04-17-2012 04:27 PM

Re: Show additional fields at customer checkout only if a checked box is checked
 
We did something like this by adding an onclick to the checkbox which points to a function like this:
Code:

function toggleOtherFields(c) {

        if (c.checked) {
                $("#otherField1").show("fast")
                $("#otherField2").show("fast")
        } else {
                $("#otherField1").hide("fast")
                $("#otherField2").hide("fast")
        }
}

The onclick would be like this:
Code:

onclick="toggleOtherFields(this)"
Add the appropriate ids to each element to hide/show and match the names with those set in the function.


All times are GMT -8. The time now is 11:22 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.