<SCRIPT LANGUAGE="JavaScript">
<!--//
function validate(){
var invalid = " "; //非法字符是空格你可以改为其它字符或数字
if (document.submitform.filename.value.indexOf(invalid) > -1) {
alert("文件名不能含有空格!");
return false;
}
else {
return true;
}
}
// -->
</script>
<form name=submitform >
<input type=file name=filename>
<p>
<input type=submit value="Submit">
</form>
时间: 2024-11-01 17:54:55