Jump to content

Help with sub account field


nay27uk

Recommended Posts

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 by nay27uk
Link to comment
Share on other sites

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}'>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated