| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3510 人关注过本帖, 2 人收藏
标题:模拟网页输入框的切换焦点
只看楼主 加入收藏
sych
Rank: 6Rank: 6
等 级:侠之大者
威 望:7
帖 子:317
专家分:448
注 册:2019-10-11
收藏
得分:0 
$('#kprqjy')这些不知道啥意思?咋调用
2022-02-23 21:34
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10607
专家分:43186
注 册:2014-5-20
收藏
得分:0 
直接由afcdm、ahmch返回结果有可能不对,尤其是afcdm,ahmch好象能保证长度8个字符就可以

参考源码改写
程序代码:
TEXT TO fpdmCode TEXTMERGE NOSHOW PRETEXT 15
    var isFpdm = function(fpdm){
        var _0x2cbf61 = _0x1136c8;
        if (exec) 
            return false;
        var _0x5906a4 = fpdm;
        if ('' === _0x5906a4)
            return false;
        if ((_0x5906a4[_0x2cbf61(0x183)] == 0xa || _0x5906a4['length'] == 0xc) && _0x5906a4[_0x2cbf61(0x19a)](',') === -0x1){
            return (typeof(afcdm(_0x5906a4))=="undefined");
        }
        $(_0x2cbf61(0x1d7))[_0x2cbf61(0x176)](_0x2cbf61(0x1a7));
        $('#fpdmjy')[_0x2cbf61(0x176)]('font_red');
        $(_0x2cbf61(0x1d7))[_0x2cbf61(0x1df)](_0x2cbf61(0x18b));
        acb(fplx);
        return false;
    };
ENDTEXT
TEXT TO fphmCode TEXTMERGE NOSHOW PRETEXT 15
    var isFphm = function(fphm){
        var _0x132aa0 = _0x1136c8;
        _0x2fe9eb = fphm;
        if (_0x2fe9eb[_0x132aa0(0x183)] != 0x0 && _0x2fe9eb['length'] == 0x8){
            ahmch(_0x2fe9eb);
            return true;
        }
        $('#fphmjy')['removeClass']();
        $(_0x132aa0(0x186))[_0x132aa0(0x176)](_0x132aa0(0x1c6));
        $(_0x132aa0(0x186))['html']('请输入发票号码');
        afcdm(fpdm);
        setFplxByFphm(_0x2fe9eb);
        acb(fplx);
        return false;
    };
ENDTEXT
of = CREATEOBJECT("webForm")
of.show
READ EVENTS
RETURN

DEFINE CLASS webForm AS Form
    ShowWindow = 2
    WindowState = 2
    ADD OBJECT txt1 as textbox WITH left=10,top=10,width=130,height=22,value="051002000511"
    ADD OBJECT txt2 as textbox WITH left=150,top=10,width=130,height=22,value="12345678"
    ADD OBJECT cmd1 as commandbutton WITH left=290,top=10,height=22,Enabled=0,caption="test"
    ADD OBJECT WB AS Olecontrol WITH left=0,top=42, Width=this.width,Height=this.height-42,Anchor=15,OleClass="Shell.Explorer.2",Visible=.T.
    PROCEDURE Destroy
        CLEAR EVENTS
    ENDPROC
    PROCEDURE Init
        this.WB.Silent = 0  &&提示安全证书问题警告
        this.WB.Navigate("https://inv-veri.chinatax.)
    ENDPROC
    PROCEDURE WB.documentComplete(pdisp, url)
        IF SYS(3095,pdisp)==SYS(3095,this)
            thisform.wb.Document.parentWindow.execScript(fpdmCode)
            thisform.wb.Document.parentWindow.execScript(fphmCode)
            thisform.cmd1.Enabled = 1
        ENDIF
    ENDPROC   
    PROCEDURE cmd1.click
        cFpdm = ALLTRIM(thisform.txt1.value)
        bFpdm = thisform.wb.document.Script.isFpdm(cFpdm)
        thisform.caption = "发票代码 "+ cFpdm + IIF(bFpdm," 正确"," 错误")
        cFphm = ALLTRIM(thisform.txt2.value)
        bFphm = thisform.wb.document.Script.isFphm(cFphm)
        thisform.caption = thisform.caption+"    发票号码 "+ cFphm + IIF(bFphm," 正确"," 错误")
    ENDPROC
ENDDEFINE
2022-02-23 21:56
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10607
专家分:43186
注 册:2014-5-20
收藏
得分:0 
以下是引用sych在2022-2-23 21:34:52的发言:

$('#kprqjy')这些不知道啥意思?咋调用

相当于
Document.getElementByid("kprqjy")
2022-02-23 21:58
sych
Rank: 6Rank: 6
等 级:侠之大者
威 望:7
帖 子:317
专家分:448
注 册:2019-10-11
收藏
得分:0 
好的,谢谢,今天学习了不少新知识,抽空还要补充一下相关知识点
2022-02-23 21:58
快速回复:模拟网页输入框的切换焦点
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.038677 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved