你这个说的太宽泛了这也是你不能解决问题的原因
<form onsubmit="return check_submit(); "这个应该是这样使用  
function check_submit(){
var name = $('name');
if(name.value == ''){
showDialog('姓名不能为空','','',function(){
   name.focus();
   });
return false;
}
return true   //既然你的函数是有返回值的  那么要保证 每个执行路径都有返回}

解决方案 »

  1.   

    <input name="name" id="name" type="text" size="10" /><form id="form" name="form" method="post" onsubmit="return check_submit()" action="?" enctype="multipart/form-data" >
        <input name="name" id="name" type="text" size="10" />
        <input type="submit" name="submit" style="height:25px;" value="提交" />
    </form>
    <script type='text/javascript'>
        function $(){
            return document.getElementById(arguments[0]);
        }
        function check_submit(){
            var name = $('name');
            if(name.value == ''){
    //            showDialog('姓名不能为空','','',function(){
    //                name.focus();
    //            });
                alert('姓名不能为空!');
                return false;
            }
            alert('姓名有效!');
            return true;    }
    </script>