Handsontable example
HTML
<script src="https://cdn.jsdelivr.net/npm/handsontable@10.0/dist/handsontable.full.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable@10.0/dist/handsontable.full.min.css" />
<script src="https://handsontable.com/docs/8.3.2/components/numbro/dist/languages.min.js"></script>
<div id="example1" class="hot "></div>
<button class="btn">Sumbit</button>
JavaScript
const container = document.querySelector('#example1');
const hot = new Handsontable(container, {
data: [
[5,2,63,8,9]
],
colHeaders: true,
type: 'numeric',
licenseKey: 'non-commercial-and-evaluation',
afterValidate: function(isValid){
if(!isValid){
console.log('there is at least one invalid cell')
} else {
console.log('All is good')
}
}
});
document.querySelector('.btn').addEventListener('click', function(){
hot.validateCells()
})