Button Click: Clear the contents of a Multi-Line Text Box

  • 5 August 2019
  • 5 replies
  • 101 views

Userlevel 4
Badge +10

Hi Folks,

I have a form and a reset button in one of the sections. The button should clear a Checkbox, a text field, a date field, and a multi-line text field. This workd fine for me currently with the code below as the MLT control is connected to a "Multiple lines of text" list column set as "Plain Text".

function resetCancellation()
	{
		NWF$('#'+ jsvar_CancelCheck_CHK).attr('checked',false);
		NWF$('#'+ jsvar_CancellationComments_MLT).val("");
		NWF$('#'+ jsvar_CancellationDate_DTE).val("");
		NWF$('#'+ jsvar_CancellationSignature_TXT).val("");
	}

This solution is adequate for me at the moment but what if I wanted to set the Multiple lines of text" list column to "Rich Text" or "Enhanced Rich Text"? The javascript above does not work for that configuration. I saw some info 5that seemed related here but could not seem to understand how to make it work for the button click scenario.

Does anyone have any advice on how one would change my function to clear the MLT connected to Rich Text?

 

Thanks and Regards,

Patrick

 


5 replies

Badge

Try  NWF$('#'+ jsvar_CancellationComments_MLT).val('').change();

This works for my multiline "Enhanced Rich Text"

 
Userlevel 4
Badge +10

Thanks @mohithmk7878!

Badge

@mohithmk7878 wrote:

Try  NWF$('#'+ jsvar_CancellationComments_MLT).val('').change();

This works for my multiline "Enhanced Rich Text" fireboy and watergirl


Thank mohith, it works :D 

Userlevel 4
Badge +10

@bickela 

 

Userlevel 4
Badge +10

@lowecm 

Reply