I'm using Login to enable web visitors to login to their private pages. That's all good.
Now I need to add a check box that requires them to agree to terms before they login.
I'm assuming that I can simply add a field to the standard loginTpl and use the valiation parameter in the same way that FormIt or Register extras do. I have working examples of this in both Formit and Register, but can't get it to work in Login. Login seems to just ignore it.
Is my assumption correct? Does validation works the same with Login?
Here's what I've got.
[[!login?
&loginTpl=`mylgnLoginTpl`
&validate=`terms:required`
]]
Here's the checkbox I added to the form.
[[!+fi.error.terms]]
<label>I agree to the terms</label>
<input type="hidden" name="terms" value="" />
<input id="yes" type="checkbox" class="" name="terms" value="Yes" [[!+fi.terms:FormItIsChecked=`Yes`]] >Yes
I also tried this with: name="terms[]" vs name="terms" (which works in Subscribe)
<label>I agree to the terms</label>
<input type="hidden" name="terms[]" value="" />
<input id="yes" type="checkbox" class="" name="terms[]" value="Yes" [[!+fi.terms:FormItIsChecked=`Yes`]] >Yes
When I submit, there is no validation and the form will login if left unchecked.
I have to assume that would be a common requirement, yet I didn't find anything on this in forums specifically for Login.
How do I make this work?