Skip to main content

Hi There,

I am creating a form which has many questions with a Yes/No answer in a drop down list for each question.

Each question has a Multi line textbox for adding comments.

If the answer is "No" then the textbox will be disabled and no comments can be added.

If the answer is "Yes" then the textbox will be enabled and a comment can be added.

The problem i am facing is that when i answer "Yes" and add a comment to the textbox, then i change the answer to "No", the Textbox will get disabled and it will keep the comments i already added for a "Yes" answer.

Is there a way to reset the Textbox everytime the selected answer is "No" before disabling the Textbox?

that's only possible with javascript, have a look on following

https://community.nintex.com/message/37015?commentID=37015#comment-37015 


Hi Marian,

Thank you for the help,

can you please advise me where to create the javascript? i mean in which control should it be?

Thank you.


in initex forms all the custom code has to be placed into form settings. either directly into custom javascript input box or as a include reference into advanced block.

as well the code from linked thread is just effective snippet that changes content of multiline text box (reach text enabled). in your case you have to wrap it up into yes/no control onchange handler.

your whole code might look like:

NWF.FormFiller.Events.RegisterAfterReady(function (){
   NWF$('#' + jsvarYesNo).change(function(evt){
     if (!evt.target.status){
       NWF$('#'+ jsvarMLTB).closest('tr').find('divnid$="'+jsvarMLTB+'_inplacerte"]').html("");
     }
   })
})

jsvarYesNo is javascript variable configured for yes.no control.

likewise, jsvarMLTB is javascript variable configured for text box control.


Reply