Multiline Rich Text field

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
SpencerD
Posts: 1
Joined: Sun Mar 05, 2017

06 Mar 2017

Hi Dmitry,

I was struggling to get the value of a regular multiline rich text field (not a multiline extended RTF) from my NewForm's Save button Onclick event using the .replace(/\W/g) examples shown on this forum, but finally managed to get the inputed values and evaluate with the following:

var details = fd.field('Details').control()._el().find('.ms-rtelong').contents().find('body').text();

//alert('Details value: ' + details);

if (details == null || details == '') {
alert('Sorry, Details is a required field, please enter a value.');
return false;
}

I'm concerned this is not covering all possible test cases since I'm not doing the evaluation of char replacement, however testing blanks and carriage returns in the input field are getting caught correctly.

Do you see any potential issues with using the above, or have any comments for improving?

Thanks in advance, and appreciate the help your posts have given.

Thanks,

Spencer

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

07 Mar 2017

Hi,

What's your Forms Designer version - you can find it in the lower-right corner of Forms Designer window. The current version supports getting value of an RTE field:

Code: Select all

fd.field('Text').value()
But your code should work as well.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests