注册 登录
编程论坛 VB.NET论坛

HELP:VB2005 操作webbrowser 自动点击提交问题 javaScript

jamingfer 发布于 2008-09-17 04:41, 2318 次点击
<script language="JavaScript"><!--                     
    function AddText(NewCode) {                     
        document.post.content.value+=NewCode                 
    }                 
    function image() {                     
        txt=prompt("图片的 URL","http://");   
        if(txt!=null) {
            AddTxt="[img]"+txt;
            AddText(AddTxt);
            AddTxt="[/img]\r";   
            AddText(AddTxt);   
        }                         
    }                     
    function url() {                     
        txt=prompt("超级链接.","http://");                           
        if (txt!=null) {                     
            AddTxt="[url]"+txt;                     
            AddText(AddTxt);                     
            AddTxt="[/url]";                     
            AddText(AddTxt);                     
        }                     
    }                  
    function mood(moodid) {
        AddTxt="[img]image/brow"+moodid+".gif";
        AddText(AddTxt);
        AddTxt="[/img]";
        AddText(AddTxt);
        document.post.content.focus();
    }
    function title_focus() {
        document.post.title.focus();
    }
    function check(form) {
 
        var NoneClassID=true;
        for ( i=0; i<document.post.Class_ID.length; i++ ) {
            if ( document.post.Class_ID[i].checked ) {
                NoneClassID=false;
            }
        }
        if ( NoneClassID ) {
            alert("主题类别选项不能为空,请重新选择。");
            return false;
        }
 
        if (form.username.value == ""){
            alert("用户名不能为空,请重新输入。");
            document.post.username.focus();
            return false;}
        else if (form.password.value == ""){
            alert("密码不能为空,请重新输入。");
            document.post.password.focus();
            return false;}
        else if (form.title.value == ""){
            alert("主题内容不能为空,请重新输入。");
            document.post.title.focus();
            return false;}
        else {
            window.status="正在提交,请稍侯……";
            sbm.style.display = "none";
            tit.style.display = "";
            document.post.submit();
            return true;
        }
    }
    // --></script>
<table cellpadding=0 cellspacing=0 border=0 width=100% align=center id=sbm style="DISPLAY: "><tr><td align=middle height="25">
      <input type="button" value="  完成  " onclick='javaScript:check(post);'>
      <input type="button" value="  取消  " onclick='javaScript:history.back()'>
</td></tr></table>

怎么编写语句才能成功点击“完成”的按钮实现提交啊?插入了javaScript语句的控制怎么控制啊?
0 回复
1