It would be easiest doing it the way I suggested.
However, if you insist on using JavaScript...
this works however i now want it to work when the user clicks submit button. The form already has onsubmit="return check()"
your function is called checkInput() but I think thats just a typo in your writing on the form.
I think the function needs to return true or false, then it will be submitted. sooo try...
function checkInput() {
var str = document.getElementById("seminarT").value;
if ( str.length > 10 ) {
alert("Please enter less than 20 characters");
return false;
} else {
return true;
}
}