Auto tick a Check box

Discussion in 'HTML & Website Design' started by PRLeak, Oct 21, 2009.

  1. #1
    i want to automatically check the box on page load.

    i looked at the html and it appears to already be set to do that. however on the site this does not show

    is there any reason why this line should not check the box

    <input type="checkbox" id="AGREERULES" name="AGREERULES"{if $agreerules eq 'on'} checked="checked" {/if} />

    i appreciate your help
     
    PRLeak, Oct 21, 2009 IP
  2. Pyrokinetic

    Pyrokinetic Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    all i can see that could be wrong is maybe there's something wrong with whatever's meant to be setting $agreerules to 'on', the HTML itself is fine.
     
    Pyrokinetic, Oct 22, 2009 IP
  3. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #3
    To save yourself some time, if you are absolutely positive that you want the checkbox always checked by default, simply remove the IF conditional bits from the code, and make it look like
    <input type="checkbox" id="AGREERULES" name="AGREERULES" checked="checked" />
    Code (markup):
     
    Clive, Oct 22, 2009 IP