Minimum number of characters for submission

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Leslie
Posts: 32
Joined: Thu Dec 05, 2019

23 Nov 2020

Hello !

I have an issue list, and I need to check this on submit :
If (Status == "Validation") and (AssignedTo == current user) and (number of characters in Comments is less than 10),
then show an alert message "Please write a full comment!".

I don't know how to count characters in a string of a multiline field.

Thank you in advance for your help !

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

30 Nov 2020

Dear Leslie,
Sorry, for the delay. The following code should work (you just need to add a check for other conditions as well):

Code: Select all

fd.onsubmit(function(){
  if(fd.field('MultipleLine').value().length < 10){
    alert("Leave a proper comment");
    return false;
  }
  return true;
});
Cheers

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests