Closed RvdHout closed 3 weeks ago
That field is not required by default before saving, therefore is not checked for validity (eg. e-mail address regex). Not possible to check/validate fields which are not required.
Sure you can, just be creative
// form validation
$.fn.validation = function() {
...
if ($('#forwardaddress').length) {
$('#forwardaddress').toggleClass( 'req', $('#forwardenabled').is(':checked') );
}
...
}
I understand it can be done this way (custom code for just one field) but that is not a good programming practice.
I will deal with this on a global level in the next release.
Just to give you a idea, when dealt with on a global level it is even better
As a global solution you perhaps could give those "conditional" fields some data attribute, data-depends-on="control" and then add the 'req' class with jquery as required (similar to the above)
$.fn.hasAttr = function(name) {
return this.attr(name) !== undefined;
};
// form validation
$.fn.validation = function() {
...
// conditional checks
$('.form input, .form textarea').each(function() {
if ($(this).hasAttr('data-depends-on')){
var control = "#" + $(this).attr('data-depends-on');
$(this).toggleClass( 'req', $(control).is(':checked') );
}
});
...
}
Added in v1.6
Forwarding email address field under account accepts: test1@test.com; test2@test.com (this is invalid in hMailServer)
hMailServer accepts only a single email address under forwarding thru an account, if you like to forward it to multiple recipients you are forced to use a distribution list