theContent.html里面什么都没有啊
用input type="text" 就只能输入一行

解决方案 »

  1.   

    晕~~
    --------------------------------------
    要求
    theContent.html中只能输60个字符的长度而且屏蔽掉回车键在theMain.html中看起来要求是单行文本框的效果,OK?---------------------------------------
    谁能解决,谁给高分
      

  2.   

    因为INPUT = TEXT类型所输入的文字内容没法+URL地址连接,没法+文字样式
    所以我采取了类似文字编辑器的思路,想做个有URL地址连接,文字样式功能的"单行文本框"
      

  3.   

    在theContent.html里边放个html元素,如input,div等,不要用designMode,不然onkeypress事件不会触发
      

  4.   

    可以啊
    a.html
    <script for="document" event="onkeypress">
     if(event.keyCode ==13){
    event.returnValue = false
    alert("error");
     }
    </script>
    去掉document.designMode,用这个和onkeypress冲突
    b.html
    <body onload="javascript:document.frames[0] = 'on';">
    <iframe src="a.html" width="100%" height="100%" frameborder=1 BORDERCOLOR="#FF9933" vspace=0 hspace=0 id="Frm_theContent" name="Frm_theContent" scrolling=no marginwidth=0 marginheight=0></iframe>
    </body>
    打开b.html你按回车会触发的,显示error
      

  5.   

    楼上兄弟:b.html
    <body onload="javascript:document.frames[0] = 'on';">
    这句我测试了不起作用啊,信息输不进去,不可录入状态啊
      

  6.   

    <form name=form1>
    <textarea name=t1 cols=50 maxlength=60 style="overflow:hidden;height:20" onkeypress="if(event.keyCode==13)event.returnValue=false;"></textarea>
    <input type=button value='link' onclick='addlink();'>
    <input type=button value='color' onclick='addcolor();'>
    </form>
    <script>
    function addlink(){
    var o=document.createElement("A");
    o.href="http://www.csdn.net/";
    o.innerText="www.csdn.net";
    document.form1.t1.appendChild(o);
    }
    function addcolor(){
    var o=document.createElement("FONT");
    o.color="red";
    o.innerText="www.csdn.net";
    document.form1.t1.appendChild(o);
    }</script>