Wednesday, March 19, 2014

How to valid phone by Knockout Validation plugin ?

Add Knockout Validation reference into project from
https://github.com/ericmbarnard/Knockout-Validation

    self.Telephone = ko.observable("").extend({
        required: true,
        pattern: {
            message: '*Invalid Phone Number. (Format: 999-999-9999)',
            params: /\d{3}-\d{3}-\d{4}/
        }
    });


No comments:

Post a Comment