View Single Post
  #8  
Old 07-15-2005, 06:47 AM
 
TP TP is offline
 

Member
  
Join Date: Mar 2005
Posts: 13
 

Default

Thanks, that works really well. Whilst you were doing that, I had a go at using some other code I'd used in the past to show/hide layers and got it to work with the checkbox. I used your code in the end, but this also works:

Here is the code:

hide_block_script.tpl
Code:
{literal} <script> function toggle(theImg, divName){ if(theImg.value!='on'){ theImg.value='on' } else { theImg.value='off' } divStyle = document.getElementById(divName).style; if(theImg.value=='on'){ divStyle.display='block'; } else { divStyle.display='none'; } } </script> {/literal}

Skin1\customer\main\checkout.tpl:
Code:
{include file="hide_block_script.tpl"}

Code:
<input type="checkbox" name="checkbox" value="checkbox" onclick="toggle(this,'wrapper');"> I Agree to the Terms and Conditions

Code:
<div id="wrapper" style="display:none">{include file="buttons/button.tpl" button_title=$lng.lbl_submit_order style="button" href=$button_href} {else} {include file="submit_wo_js.tpl" value=$lng.lbl_submit_order} {/if} </div>
__________________
:: WinXP : IIS5.0
:: X-Cart v4.0.13 Gold
:: MySQL 4.1.9-nt
:: Apache 2.0.53
:: PHP 4.3.10
:: ActivePerl 5.6
Reply With Quote