:
[2009-08-15] 欢迎光临 『踏出校门之后...』----一起表达你和我对网络的热爱,一起追寻你和我痴狂的梦想,炎炎夏日让我们一起感受存在的美丽,我们的极限就是达到唯美... [2009-07-31]   温馨笑容:   热烈欢迎从远到而来的朋友,一起分享你我的喜悦,共享你我的资源。

javascript  oa 判断申请人是否与集团内同事重名(取字符串中特定字符串)

程序代码 程序代码
//Select 判断是否存在此人
var s1 = "69";
var s2 = "73";
function Selectproper()   //(关键域值,编号文档所在视图,目标域值,子表单文件名)
{
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    var u_name = '&name='+document.all.fldUser1.value;
    var url = "http://oa.china-chigo.com/chigo/bluepage.nsf/agtManageMap?openagent"+u_name;
    xmlHttp.open("post", url, false);
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    //xmlHttp.onreadystatechange = updatePage9;
    xmlHttp.send(u_name);
    
    var response = xmlHttp.responseText;
    response = response.substring(response.indexOf("<body>")+6,response.indexOf("</body>"));
    //response = response.substring(response.indexOf("<myreturn>")+10,response.indexOf("</myreturn>"));
    respnse = response.replace(/\r\n/g,"");
    //document.all.fldsapv4.value = response;
    //alert(response);
    document.all.fldsap4.value = response;
    SubstringDemo(s1,s2);
    //alert(SubstringDemo(s1,s2));
    document.all.fldsap5.value = SubstringDemo(s1,s2);    
    if (document.all.fldsap5.value!="查无此人"){
        alert("集团内已经有和申请人相同名字的同事,请查询公司通讯录,确实申请人是否为此人!");
    }
}
    
    
function   SubstringDemo(s1,s2)
{
    var ss;   //   声明变量。
    var s = document.all.fldsap4.value;
    ss = s.slice(s1,s2);   //   取子字符串。
    return(ss);   //   返回子字符串。
}




e.options[0].selected = 'selected'

如上经过运行1个月来,发现不少问题。继续做优化:

程序代码 程序代码
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            var u_name = '&name='+document.all.fldUser1.value;
            var url = "http://oa.china-chigo.com/chigo/bluepage.nsf/agtManageMap?openagent"+u_name;
            xmlHttp.open("post", url, false);
            xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
            xmlHttp.send(u_name);
            var response = xmlHttp.responseText;
            var s = response;
            var s1 = "查无此人" ;
            var s2 = document.all.fldUser1.value + "/chigo";
            var s3 = s.indexOf(s1);
            var s4 = s.indexOf(s2);
                
                if (s3 == -1&&s4 != -1){
                if (confirm("集团内已经有和申请人相同名字的同事,请查询公司通讯录,确定是否为同一人!")){
                }
                else{
                      return false;
                }
            }
              


[本日志由 confusion 于 2010-07-07 09:59 AM 编辑]
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: javaScript OA 字符串
评论: 0 | 引用: 0 | 查看次数: 142
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭