Forum

Thread tagged as: Field-Types

Simple checkbox question (default to off)

Hi, I've got a really simple checkbox question that I can't work out.

I want my checkbox to default to "off" - here's my template code...

<perch:input type="checkbox" id="iagree" />                

...and here's the HTML that gets generated: -

<input id="form1_iagree" name="iagree" type="checkbox" checked="checked" />                

Any ideas, its driving me mad?

Thanks.

Andrew Finney

Andrew Finney 0 points

  • 3 years ago

This might not work but try adding a value. Then what you have will match the example in the docs. Why having a value would make a difference to what you are seeing I don't know but worth a shot!

<perch:input type="checkbox" id="iagree" value="agreed" />

Thanks, that did it. Thought I had tried that permutation but obviously not!

Thanks again.