Validation for Popup Form
Validation for Popup Form
tdk
Posts: 32Questions: 16Answers: 0
I'm not using the client side validation so when my form submits my server side validation returns a JSON response containing the following.
{
"Name":{
"ChildNodes":null,
"Children":null,
"Key":"Name",
"SubKey":{
"Buffer":"Name",
"Offset":0,
"Length":4,
"Value":"Name",
"HasValue":true
},
"IsContainerNode":false,
"RawValue":null,
"AttemptedValue":null,
"Errors":[
{
"Exception":null,
"ErrorMessage":"'Name' must be between 3 and 60 characters. You entered 0 characters."
}
],
"ValidationState":1
}
}
What I'd like to do is display the ErrorMessage on the popup form. Is this possible?
This discussion has been closed.
Answers
Is this in Editor? If so, the manual details the responses that Editor expects to be able to have it show error information. If you'd like to return something other than that data structure (such as the above) you would need to use
postSubmit
to modify the data into the format Editor expects.Regards,
Allan
Hi Allan, thanks for the reply. I notice there are 3 divs which supposedly display info or error messages. In my postSubmit how would I utilise these divs?
You'd need to morph the JSON returned from the server into the structure expected by Editor. Editor will then populate those elements as required.
Regards,
Allan