Setting validation attribute to a bar