Share via


SP.Field.validationMessage property (sp.js)

Gets or sets a value that specifies the error message returned when data validation fails for the field.

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

var value = SP.Field.get_validationMessage ()
var value = SP.Field.set_validationMessage ()

Return value

Type: String

A String which is a message to display to the user if validation fails.

Remarks

Its length must be equal to or less than 1024.

REST resource endpoint

See Field resource for more information.

Endpoint URI structure

http://<sitecollection>/<site>/_api/web/lists(listid)/fields(fieldid)/validationMessage

HTTP requests

This resource supports the following HTTP commands:

  • POST

POST syntax

POST http://<sitecollection>/<site>/_api/web/lists(listid)/fields(fieldid)/validationMessage

GET syntax

GET http://<sitecollection>/<site>/_api/web/lists(listid)/fields(fieldid)/validationMessage