<!DOCTYPE HTML>
<html>
<head> </head>
<body>
<input type="text">
<input type="button" value="go">
<script>
var inp = document.body.children[0];
var bt = document.body.children[1]
bt.onclick = function () {
var value = inp.value;
value = value.match(/,/g);
if(value && value.length >= 10) return;
alert("Запятых меньше 10");
}
</script>
</body>
</html>