注册 登录
编程论坛 ASP技术论坛

ewebeditor怎么获得焦点?

ysf0181 发布于 2011-10-05 11:19, 1125 次点击
<textarea id="content"  style="display:none"  name="neirong"></textarea>
<IFRAME ID="content" src="ewebeditor/ewebeditor.asp?id=content&style=s_light1" frameborder="0" scrolling="no" width="550" height="350" onPropertyChange="yizhi(this.vlue)"></IFRAME>   

检查没填写时,后返回,获得鼠标焦点,晕,不知道怎么获得了。
6 回复
#2
yms1232011-10-05 12:08
document.getElementById("content").focus();
#3
ysf01812011-10-06 12:57
不行的,还是获取不到。直接提交到后台处理了,加了。
document.getElementById("content").focus();
#4
ysf01812011-10-06 16:21
难道没更好的办法吗。
#5
ysf01812011-10-06 16:46
<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()
        {
            //执行iframe页面中的AttachSubmit函数
            window.frames["eWebEditor1"].AttachSubmit();
            if(document.getElementByIdx_x("content").value != "")
            {
                alert(document.getElementByIdx_x("content").value);
            }
            else
            {
                alert("空");
            }
        }
    -->
    </script>
    </HEAD>
    <BODY>
    <FORM method="post" name="myform">
        <TABLE border="0" cellpadding="2" cellspacing="1">
            <TR>
                <TD>编辑内容:</TD>
                <TD>
                    <INPUT type="hidden" name="content" >
                    <IFRAME ID="eWebEditor1" src="ewebeditor.htm?id=content&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>
这个是获得值,能不能将鼠标直接到输入框呢?
#6
yms1232011-10-06 19:36
document.all.eWebEditor1.focus();
#7
ysf01812011-10-07 15:48
但是鼠标还是没有在输入框。
1