2
I have 4 Checkbox in my form HTML
, I am working on validations only with Jquery.Validate
, there is a way that I define that at least 1 of these checBox is triggered?
Some property of validate
? Or just creating a function in race?
I found something on here Apparently the solution seems practical and feasible, but in my case I don’t have a name for the checkedbox group
My code is like this:
<td colspan="2">Você conversou com quem?
<input type="checkbox" name="Diretor" id="Diretor" />Diretor
<input type="checkbox" name="Vice" id="Vice" />Vice-Diretor
<input type="checkbox" name="Coordenador" id="Coordenador" />Coordenador
<input type="checkbox" name="Nenhum" id="Nenhum" />Não conversei com ninguem
</td>
kkkk what I didn’t like was this phone-group . . . it comes from [library]? (http://jqueryvalidation.org/files/dist/additional-methods.min.js)
– MarceloBoni
@Marcelobonifazio adapted jsFiddle to use his HTML. But you have to join this library yes.
– Sergio
this error: Uncaught Typeerror: Cannot read Property 'param' of null at line 4 of jquery.validate.min.js
– MarceloBoni
@Marcelobonifazio can adapt my jsFiddle with your code and put here an example of jsFiddle with the error?
– Sergio
old, the problem is that here in the company we use standard libraries, we can not be adapting in this way rs type, the jquery we use is the v1.4.2 yet p.exp.... then we get kind of stuck with our technology :(
– MarceloBoni
@Marcelobonifazio then make a custom validate with simple JS... type
if( !$('.phone-group').filter(function(){ return this.checked; }) ) return false; // caso nenhum checkbox clicado
– Sergio
I adapted some business here and apparently it worked, at last, grateful old :)
– MarceloBoni