1

How can we validate a custom field while checkin in to Oracle WebCenter Content?It may be an email validation or custom validation say the file will allow user to input only 10 chars of which first four are alpha and the next sixth char are numeric.

Regards, Ananda Roy

Ananda Roy
  • 23
  • 4

1 Answers1

0

Try adding a rule to the profile (or using global rule). Then, in the rule side effect, set this: <$xCustomField:maxLength=10$>

You can get fancier validation by doing more customization such as this.

Jonathan Hult
  • 1,351
  • 2
  • 13
  • 19
  • Thank you so much Jonathan.It helped.I can restrict the field length to 10 now. – Ananda Roy Feb 05 '17 at 16:02
  • The above code limits user to enter only 10 characters; neither more nor less. I need additional validation to restrict first four as alpha and next six as numeric.I used the following code to include regex but it is not working. – Ananda Roy Feb 05 '17 at 18:57
  • <$custom_pre_complete_checkin_script = ' <$include super.custom_pre_complete_checkin_script$> var checkinForm = document.getElementsByName("Checkin")[0]; var field1 = checkinForm.xcustomField; var field2 = field1.value; var decimal= [a-zA-Z]{4}[0-9]{6}; var WIP = field1.value.length; if (WIP != 10 && (decimal.test(field1.value))) { alert("Field 1 is incorrect format"); return; } '$> <$setResourceInclude('custom_pre_complete_checkin_script', custom_pre_complete_checkin_script)$> – Ananda Roy Feb 05 '17 at 19:00
  • ,would you mention my mistake here please? – Ananda Roy Feb 05 '17 at 19:04