Skip to content

Cannot validate class for a custom attribute when create a product in back-end #1604

@lucbaojang

Description

@lucbaojang

I created a custom attribute with the input type for products in the back-end, and add new class for it. It called "validate-custom-attribute".

I also add this javascript codes but when I save product, it is still passed.

How can I validate it?

Validation.add("validate-custom-attribute", "Input not correct", function(v) {
parten=/^(\d.{0,1},{0,1})+$/;
return (parten.test($("gift_dropdown").value));
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions