在网上找了一些,都是如下的方法:
<HTML>  
  
<HEAD>  
  
<TITLE>eWebEditor : 标准调用示例</TITLE>  
  
<META http-equiv=Content-Type content="text/html; charset=gb2312">  
  
<link rel='stylesheet' type='text/css' href='example.css'>  
  
<script>  
  
    function validateForm(){   
       
        window.frames["eWebEditor1"].AttachSubmit();
  
        if(document.getElementById("content1").value!=""){   
  
            document.getElementById("myform").submit();   
  
        }else{   
  
            alert("空");   
  
        }   
  
    }   
  
</script>  
  
</HEAD>  
  
<BODY>  
  
<FORM method="post" name="myform" action="rs.jsp">  
  
<TABLE border="0" cellpadding="2" cellspacing="1">  
  
<TR>  
  
    <TD>编辑内容:</TD>  
  
    <TD>  
  
        <INPUT type="hidden" name="content1" >  
  
        <IFRAME ID="eWebEditor1" src="../ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="550" height="350"></IFRAME>  
  
    </TD>  
  
</TR>  
  
<TR>  
  
    <TD colspan=2 align=right>  
  
    <INPUT type=button value="提交" onclick="validateForm()">    
  
    <INPUT type=reset value="重填">    
  
    <INPUT type=button value="查看源文件" onclick="location.replace('view-source:'+location)">    
  
    </TD>  
  
</TR>  
  
</TABLE>  
  
</FORM>  
  
</BODY>  
  
</HTML>  
即使这样拷贝的,在我的上面也不能够取到正确的值,为什么呢?
是和IE有关么?

解决方案 »

  1.   

    不太明白楼主的意思,不过代码中的这句:
     <INPUT type=button value="查看源文件" onclick="location.replace('view-source:'+location)">
    view-source命令在firefox中好使,在ie8中好像不好使~~
      

  2.   

    <HTML>  
      
    <HEAD>  
      
    <TITLE>eWebEditor : 标准调用示例 </TITLE>  
      
    <META http-equiv=Content-Type content="text/html; charset=gb2312">  
      
    <link rel='stylesheet' type='text/css' href='example.css'>  
      
    <script>  
      
        function validateForm(){  
          
            window.frames["eWebEditor1"].AttachSubmit(); 
      
            if(document.getElementById("content1").value!=""){  
      
                document.getElementById("myform").submit();  
      
            }else{  
      
                alert("空");  
      
            }  
      
        }  
      
    </script>  
      
    </HEAD>  
      
    <BODY>  
      
    <FORM method="post" name="myform" action="rs.jsp">  
      
    <TABLE border="0" cellpadding="2" cellspacing="1">  
      
    <TR>  
      
        <TD>编辑内容: </TD>  
      
        <TD>  
      
            <INPUT type="hidden" name="content1" >  
      
            <IFRAME ID="eWebEditor1" src="../ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="550" height="350"> </IFRAME>  
      
        </TD>  
      
    </TR>  
      
    <TR>  
      
        <TD colspan=2 align=right>  
      
        <INPUT type=button value="提交" onclick="validateForm()">    
        
        </TD>  
      
    </TR>  
      
    </TABLE>  
      
    </FORM>  
      
    </BODY>  
      
    </HTML>  
    查看源文件那行暂时不用了,
    我想通过JS里获取content1的内容,到提交后另一个页面。
    但我这样取得的还是为空值,为什么?
      

  3.   

    <INPUT type="hidden" name="content1" > 这个里面隐藏的是一个名字为 content1.但是这个东西是否是有值呢?
     if(document.getElementById("content1").value!=""){  
            document.getElementById("myform").submit();  
      }else{  
             alert("空");  
      } 
    你试试 alert(document.getElementById("eWebEditor1").value); 看看是否是为空
    希望能给你看出来点问题。
      

  4.   

    你是要 
            window.frames["eWebEditor1"].AttachSubmit(); 
    后对
           document.getElementById("content1") 进行赋值?然后再取 document.getElementById("content1").value?-----------------------考虑 AttachSubmit(); 如果是异步操作,就不能马上就获取content1的值,需要有个延时,你可以设一个延时时间,或设一个开关变量,AttachSubmit()中设置这个变量,然后再根据这个变量是否有效来确定是否已赋值完成?
      
      

  5.   

    是enctype="multipart/form-data"再作怪,
    这个是以2进制来传递数据,
    而eWebEditor是以String来传递数据的
      

  6.   

    您的意思是用getText来获取?但是如果是上传的图片之类的东西就没有连接了呀