CMDBuild Forum

Problem with validation rulles

Hi, I set a validation rule on the class attribute.
It is always validated twice and duplicate messages are output.

Please tell me the cause and how to deal with it.

Regards.

1 Like

Hey, could you please point me into docs how to write those rules? It seems I can’t find it anywhere. Thanks!

1 Like

If someone will come across this, here’s how I’ve solved this with simple JavaScript for validating Attribute named “MACAddress”:

var _pattern = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/;
var _str = document.getElementsByName(“MACAddress”)[0].value;
var _match = _pattern.test(_str);
return _match;

3 Likes

Thanks for the example.