Updating Multi Line Textbox control issue

  • 11 September 2014
  • 7 replies
  • 3 views

Badge +1

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.


7 replies

Userlevel 7
Badge +17

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").

Userlevel 5
Badge +12

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!

Badge +1

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!

Userlevel 5
Badge +12

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

Badge

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

Badge +5

Hi Ankita,

I tried below code to get value from single line of text box and update the same value in some other text box on radio button click event

but it's not working for me. can you please give suggestions.

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

    var rad = NWF$('#' + mychoice123); 

  rad.find('input').on('change', function(){ 

      

var strMyRadioButtonValue = NWF$('#'+mychoice123).find("input:checked").val();

alert(strMyRadioButtonValue);

if(strMyRadioButtonValue=="Yes")

{

alert('came inside if condition');

var PhoneOffice = NWF$('#'+PhoneOffice).val();

alert(PhoneOffice);

NWF$('#'+PhoneMailing).val(PhoneOffice);

}

});

});            

it's going inside if condition and triggering alert but not getting value of text box. Frank FieldVadim TabakmanEuan GambleJan Eyres

Badge +4

why when I use IF Condition with single line of text ( this single line of text get his data from another control through java script) if condition not working correctly???

Reply