Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to delete the content of ace editor on a validation error

Tags:

ace-editor

My question is related to set focus on ace editor

This time I want to delete the content whenever there is a validation error.

I have the used the pattern like

/^[0-4]$/ and /^([1-9][0-9]{0,3}|[1-5][0-9]{4}|60000)$/;

to check the value between 0-4 and 1-60000 respectively. When user provides invalid data my text area is cleared but not the ace editor. I also tried

    $scope.close = function () {
rowObj.entity.value = editor.getValue();
            editor.setValue("",0);
                };

but that is not working.

like image 896
Sudip7 Avatar asked Feb 13 '23 09:02

Sudip7


1 Answers

to clear editor simply call editor.setValue("")

like image 143
a user Avatar answered May 01 '23 14:05

a user