cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Updating Multi Line Textbox control issue

Jump to solution

I am able to update single textbox using NWF$('#'+ varTitle).val("Message"); method, but it doesn't work on Multi Line Texbox

Anyone can help?

Thank you in advance.

Labels: (2)
Reply
11 Replies
Workflow Hero

Re: Updating Multi Line Textbox control issue

Jump to solution

The query looks correct, but are you sure the ID of the textarea is correctly defined by #+ varTitle? Sometimes they have unique IDs. For each control on the form you can assign a unique CSS class. I've used the class to find the control using NWF$(.myclass).val("MyValue").

Reply
Workflow Hero

Re: Updating Multi Line Textbox control issue

Jump to solution

Hello,


Do you have other Javascript within the form as well?  Some other part of your code may be interfering with this.   Create a new form and put a multiline text field on it.  Give it the same variable name and try something like the following to just to rule out that its not something else causing the issue:

NWF$(document).ready(function() {

     NWF$('#'+varTitle).val("Message");

});

Let us know what you find!

Reply
Workflow Hero

Re: Updating Multi Line Textbox control issue

Jump to solution

That code works perfectly well with normal single line text box but no on a rich text box.

I managed to figure out a way to populate text to a rich text box as follow:

var txtArea = NWF$('#'+ varInventorytxt).closest('tr').find('div[id$="_inplacerte"]');

txtArea.html("testing 123");

Enjoy!

Reply
Workflow Hero

Re: Updating Multi Line Textbox control issue

Jump to solution

The reason it worked for me is the original post said multiline text box - not a rich text box.  That makes sense.

Reply
Not applicable

Re: Updating Multi Line Textbox control issue

Jump to solution

Hi,

I tried using the suggestion given by mike. But it didn't work.

Mine is a Multiline Text control and I have no other Javascripts.

But it didn't apply the value.

Any suggestions?

0 Kudos
Reply
Not applicable

Re: Updating Multi Line Textbox control issue

Jump to solution

I want the multiline text box to get the value set automatically based on the click on a radio button

But it should allow the users to change the value.

Currently I am able to set the value based on the radio button. But on "save" button user entered value gets reset.

In the below set, If "No" is selected in the radio button it should allow users to enter their own value. Below javascript does that. But on "Save" button click, it calls the javascript again and user entered value gets lost.

function goStep()

{

var varRdb= NWF$("#"+myRdbtn);

var strMyRadioButtonValue =

NWF$('#'+myRdbtn).find("input:checked").val();

alert(strMyRadioButtonValue);

var contactAddress

=

NWF$('#'+MyCalcValue).val();

alert(contactAddress);

//NWF$('#'+VarBCAddress).val(contactAddress);

if(strMyRadioButtonValue

==

"Yes")

{

NWF$('#'+varMultiTitle).val(contactAddress);

}

else

{

NWF$('#'+varMultiTitle).val("");

}

}

0 Kudos
Reply
Workflow Hero

Re: Updating Multi Line Textbox control issue

Jump to solution

Hi Joseph,

I was trying to get the Multi Line Textbox value from Javascript. I tried all the possible methods and suggestions mentioned in different site. Luckily I saw your msg on this site and tried that and it worked!!!!

Thanks,

Sukesh

Reply
Not applicable

Re: Updating Multi Line Textbox control issue

Jump to solution

Glad to hear it!

Reply
Not applicable

Re: Updating Multi Line Textbox control issue

Jump to solution

I am trying to focus on rich text box but is is not working for it. However it is working for single line of text box...

0 Kudos
Reply