This is a migrated thread and some comments may be shown as answers.

Simple question about datasource validation field names

2 Answers 83 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Mat
Top achievements
Rank 1
Mat asked on 04 May 2012, 02:34 PM
Apologies if this has been answered elsewhere... I couldn't find it. 

When configuring the validation settings in a datasouce model, is there a way to specify a different label for the field name that is displayed in the validation message.

I don't really want custom validation messages, just something like: Reference is a required field, rather than ref_number is a required field

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 04 May 2012, 02:53 PM
Hi Mat,

You could set your own validation messages through the dataSource's schema. Here is the syntax:
schema: {
    model: {
        id: "ProductID",
        fields: {
            ProductID: { editable: false, nullable: true },
            ProductName: {
                validation: { required: { message: "CustomMsg" } }
            },
            Discontinued: { type: "boolean" }
        }
    }
}

I hope this information helps.

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Mat
Top achievements
Rank 1
answered on 04 May 2012, 04:51 PM
Yes. That's simple enough.

Thanks.
Tags
Data Source
Asked by
Mat
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Mat
Top achievements
Rank 1
Share this question
or