<INPUT type="file" onKeyDown="event.returnValue = false"/>

解决方案 »

  1.   

    <input type="file" onKeyDown ="return false">
    呵呵,event是onKeyDown,在那里用onFocus试了半天!
      

  2.   

    <script>
    function UpLoadForm_Validator(pUpLoadForm)
    {
    if(document.all.UpLoadFile.value=="")
    {
    window.confirm("请选择上传的文档!");
    pUpLoadForm.UpLoadFile.focus();
    return false;
    }
    var strFileFormat=pUpLoadForm.UpLoadFile.value.match(/^(.*)(\.)(.{1,8})$/)[3];//检查上传文件格式
    strFileFormat=strFileFormat.toUpperCase();
    if(strFileFormat=="DOC"||strFileFormat=="DOT")
    {
    }
    else
    {
    window.confirm("只能上传.Doc和.Dot,请重新选择!");
    return false;
    }
    return true;
    }</script>
    <form method="POST" enctype="multipart/form-data" action="" onsubmit="return UpLoadForm_Validator(this)" laguage="JavaScript" name="UpLoadForm">
    <input type="file" name="UpLoadFile" id="UpLoadFile" style="visibility:hidden;">
    <input type=button onclick="UpLoadFile.click();">
    <input type="submit" value="上传" name="UpLoadButton">
    </form>
      

  3.   

    <input type="text" contentEditable="false">
      

  4.   


      唉!本来说好的,解决问题就结帖,可是昨天刚回复完,我们楼就停电了.
      折腾了好久,等来电的时候把这茬给忘了!对不起了,兄弟们!
      不过,gjd111686(数字金刚)给了我一个以外的惊喜,我正想办法怎么验证表单域的提交呢!谢谢了!