nay27uk Posted February 12, 2011 Share Posted February 12, 2011 (edited) Hi all I am stuck on somthing. On the clientaddcontact.tpl I am trying to make the following code <tr class='fieldarea'> <td>{$LANG.subaccountactivate}</td> <td><input type="checkbox" name="subaccount" id="subaccount"{if $subaccount} checked{/if} /> <label for="subaccount">{$LANG.subaccountactivatedesc}</label></td> </tr> display one color when the check box is unchecked and another when it is checked I already have my CSS classes and the java script in place and working on the rest of the sub account fields but to make the alternating table row colors corect when the checkbox is checked and uncheked I need to add some sort of {if statement} but dont know what to use as the {if statement} I have tried everything i can think off but nothing works. can anyone tell me what statement to use for the following If the box is checked then display <tr class='subaccountfields'> <td>{$LANG.subaccountactivate}</td> <td><input type="checkbox" name="subaccount" id="subaccount"{if $subaccount} checked{/if} /> <label for="subaccount">{$LANG.subaccountactivatedesc}</label></td> </tr>] If the box is unchecked then display <tr class='subaccountfileds2'> <td>{$LANG.subaccountactivate}</td> <td><input type="checkbox" name="subaccount" id="subaccount"{if $subaccount} checked{/if} /> <label for="subaccount">{$LANG.subaccountactivatedesc}</label></td> </tr> I am aware that because of the javascript I canot assign a subaccountfileds class to that row otherwise it would hide that row aswell, BUT if I know the corect {if statement} to use on the row I can assign two new classes thanks Edited February 12, 2011 by nay27uk 0 Quote Link to comment Share on other sites More sharing options...
GGWH-James Posted February 12, 2011 Share Posted February 12, 2011 Is this what you're wanting? <tr class='subaccountfields{if $subaccount}2{/if}'> 0 Quote Link to comment Share on other sites More sharing options...
nay27uk Posted February 12, 2011 Author Share Posted February 12, 2011 Thanks james. I will try this later today its 3.49am here in the uk and I realy need to get some sleep, but thanks for your sugestion 0 Quote Link to comment Share on other sites More sharing options...
nay27uk Posted February 12, 2011 Author Share Posted February 12, 2011 Hi James. Unfotunatly this didnt work my friend I even tried changing the code around to the following but nothing seems to do what I want. So I welcome any other ideas. This is what I have tried bearing in mind I have now added new classes to the CSS so as they dont colide with the javascript <tr class='subaccountfields{if $subaccount}3{/if}'> <tr class='subaccountfields3{if $subaccount}subaccountfields4{/if}'> <tr class='{if $subaccount}subaccountfields3 {else} subaccountfields4{/if}'> this one stops the page loading <tr class='{if $subaccount}subaccountfields3 {else if} subaccountfields4{/if}'> 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.