Clear text coming from Laravel

Asked

Viewed 24 times

1

I am with the following scenario, using the Plugin summernote for a textarea with the settings:

<textarea id="summernote" name="editordata">{{$termos->termos}}</textarea>

It returns from the database correctly, however I am creating a buttom to try to clean the data in case the customer wants to rewrite.

Code line:

<button type="button" class="text-center btn btn-warning" id="limpar">Limpar</button>

And the jQuery this way as follows:

$('#limpar').click(function() {
    $('#summernote').val(" ");
});

I tried the empyt() also without success, someone would have some solution to this impasse?

1 answer

0


According to the documentation you need to make one reset https://summernote.org/deep-dive/#reset

Reset: Clear the editor content and remove all stored history.

So I know script should look like this

$('#limpar').click(function() {
    $('#summernote').summernote('reset');
});
  • It worked perfectly. Thank you

  • @Betinio.Heleno without problems my dear [s]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.