Hello
I'm trying to implement links validation to show error if user enters invalid URL for weblink and not to close creation link popup.
So how can i control link popup?
Thanks in advance.
I managed to do url validation, the code is not perfect, but works.
var tooltipSave = quillInstance.theme.tooltip.save;
quillInstance.theme.tooltip.save = function() {
// overwrite save link functionality
var url = this.textbox.value;
if(url.indexOf('http') === -1) {
url = 'http://' + url;
}
$(this.textbox).removeClass('ql-error');
// validate url
if(util.validateURL(url)) {
tooltipSave.call(this);
}
else {
// show error in tooltip
$(this.textbox).addClass('ql-error');
}
};
Looks like you've found a solution. Closing.
Most helpful comment
I managed to do url validation, the code is not perfect, but works.