Client validation

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2012 03:38 PM
Is there some client validation that can be performed, e.g. the user edits some metadata values => now I want to limit the number of characters or just allow a maximum integer value for certain properties => is there a way to realize this in OpenWorkdesk?
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2012 02:44 AM
Hi Popeye,
yes we have a concept in OpenWorkdesk that supports your requested client validation. There is a JS file "common.js" that is located in your repository in the folder "js". This JS file has a method "onCustomValidation()" that is always called after the user has entered some text into a input field => here you can implement your validation, e.g. limit the text length of the property "cmis:document.cmis:name":
yes we have a concept in OpenWorkdesk that supports your requested client validation. There is a JS file "common.js" that is located in your repository in the folder "js". This JS file has a method "onCustomValidation()" that is always called after the user has entered some text into a input field => here you can implement your validation, e.g. limit the text length of the property "cmis:document.cmis:name":
function onCustomValidation (classname, javaclassname, fieldprovidertype, fieldprovidername, fieldid, value){if(classname=="cmis:document.cmis:name"){if(value.length>10){//limit the string to the first 10 charactersdocument.getElementById(fieldid).value=value.substring(0,10);return(" The maximum length of this property should be less than 10 characters.");}else{return(null);}}return(null);}

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2012 03:04 PM
OK thanks, that sounds good and covers most of my requirements. But is there also a way to disable the save button…I really don't want to allow the user to save the changes…
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2012 03:12 PM
It is possible to block the save button, but it does not appear to be possible to block the enter key in all cases from submitting the form.
Here is a code snippet how to disable the save button in the common.js:
document.getElementById('<NameOfYourButton>).disabled=true;
Here is a code snippet how to disable the save button in the common.js:
document.getElementById('<NameOfYourButton>).disabled=true;
