I am using jquery.validate
and I have the following problem, I have an image field, that when the image does not exist I fill it with a img
by default ... but I need that field to be required and it is not an option have the default image saved in bd
. I need something like this:
$('#idForm).validate({
rules:{
name:{
required:true
},
photo:{
required:imgNew?true:false
}
}
})
So what I want to validate is if the variable has value and not if the field has a value.
the field img
has the following:
<img ng-src="{{imgSrc ? imgSrc : '/images/no-image.jpg'}}" data- toggle="modal" data-target="#avatar-modal">
In this modal there is a file type input that gives value to the variable imgSrc
. What I need is for you to put the poster as jquery.validate
does when variable is null or empty. Greetings