Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap and wysihtml5 updating textarea

I'm using :

  • wysihtml5
  • bootstrap-wysihtml5.js

I have a textarea called Booking_CancellationComments_CancellationPolicy and am making it a wysihtml5 textarea using this code:

$('#Booking_CancellationComments_CancellationPolicy').wysihtml5(options);

I'm trying to update it later using:

$('#Booking_CancellationComments_CancellationPolicy').val(data.Booking.CancellationComments.CancellationPolicy);

But the textarea isn't updating. I've looked at lots of answers on Stack Overflow and not show how to update the textarea using the initialisation method I've used.

Any help appreciated.

like image 545
Matt Avatar asked Jan 26 '26 13:01

Matt


1 Answers

Try this:

$('#Booking_CancellationComments_CancellationPolicy').data("wysihtml5").editor.setValue(data.Booking.CancellationComments.CancellationPolicy);

like image 81
mozgras Avatar answered Jan 29 '26 09:01

mozgras