Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Checkbox input field

Quote Reply
Checkbox input field
Hi,

Need some help with checkbox input field.

What I'am trying to do is have the checkbox field stay checked when there is an error on other fields.

For example if they check receive mail and they don't enter there URL the checkbox field on receive mail has to be checked again on the error page, I would like it to stay checked.

Hopefully I explained this well enough.



<div class="row required clear">
<label for="Receive Mail" class="name">Receive Mail: <span>*</span></label>
<div class="value">
<input type="checkbox" id="Receive_Mail" name="Receive_Mail" value="Yes"> I agreed to receive mail.
</div>
</div>

Thanks in advance for any help!
Quote Reply
Re: [rascal] Checkbox input field In reply to
Hi,

Below should work


<div class="row required clear">
<label for="Receive Mail" class="name">Receive Mail: <span>*</span></label>
<div class="value">
<input type="checkbox" id="Receive_Mail" name="Receive_Mail" value="Yes" <%if Receive_Mail eq "Yes"%>checked<%endif%>> I agreed to receive mail.
</div>
</div>


Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Checkbox input field In reply to
Thanks Tandat,

It Worked!