client side validation for unique recorn in database
client side validation for unique recorn in database
hanyelbana
Posts: 24Questions: 0Answers: 0
Hi,
Some records in my database is unique, in Editor when user add duplicate date he get this error "An error has occurred - Please contact the system administrator".
Is there any method to display JSON error which returned from the server as friendly error for the user?
and How to translate this error?
Thanks
Some records in my database is unique, in Editor when user add duplicate date he get this error "An error has occurred - Please contact the system administrator".
Is there any method to display JSON error which returned from the server as friendly error for the user?
and How to translate this error?
Thanks
This discussion has been closed.
Replies
That can't be translated as the user should never see that error.
What I think you want to do is use server-side validation and reject the field if it found to be a duplicate. If it is, then you can return a string which will be shown as the error message - so you can translate the error message there. If you look at this page http://editor.datatables.net/server/ , the section "Add new record with a field error" shows how to return a server-side error for a field: Add new record with a field error
Allan