Asked by duncanb7
at 2024-04-14 15:00:40
Point:500 Replies:7 POST_ID:828474USER_ID:11059
Topic:
Hypertext Markup Language (HTML);Visual Basic Programming;JavaScript
I have one site to login with my login and password by my automation login in VBA. For auto input login/passwrod name,
I can handle by .document.all("USERNAME)="myusername",etc, But for submit button, it has issue becuase
it use "a" tag with href by click. Actually it is not difficult at all if just use a seach do loop as follows
it works fine for me,no any issue up to this moment, but the click to javascript file name of "javascript:PCAQT_validate()"
is always changed by the website adm . So it let me always change my code to adopt its change that is not good.
So I try to other method in its html, at the <a> tag below <img> tag's alt="Sumbit" is always NO change. So I just
ask whether I can check getelementsbyTagName("img").item(0).alt="Sumbit" then go back one node backwards
to its parent node of <a> tage and do a .click. Like we go back one backward step in looking directory in PC at D:cd ...dir-name
Please advise whether it is possbile using img tab's alt and do <a> click
Duncan
Use href to locate the sumbit click in VBA
============================
g=0
do until g>100
if .document.getelementsbyTagName("a").item(g).href= "javascript:PCAQT_validate()" then
.document.getelementsbyTagName("a").item(g).click
g=200
Endif
g=g+1
loop
I can handle by .document.all("USERNAME)="myusername",etc, But for submit button, it has issue becuase
it use "a" tag with href by click. Actually it is not difficult at all if just use a seach do loop as follows
it works fine for me,no any issue up to this moment, but the click to javascript file name of "javascript:PCAQT_validate()"
is always changed by the website adm . So it let me always change my code to adopt its change that is not good.
So I try to other method in its html, at the <a> tag below <img> tag's alt="Sumbit" is always NO change. So I just
ask whether I can check getelementsbyTagName("img").item(0).alt="Sumbit" then go back one node backwards
to its parent node of <a> tage and do a .click. Like we go back one backward step in looking directory in PC at D:cd ...dir-name
Please advise whether it is possbile using img tab's alt and do <a> click
Duncan
Use href to locate the sumbit click in VBA
============================
g=0
do until g>100
if .document.getelementsbyTagName("a").item(g).href= "javascript:PCAQT_validate()" then
.document.getelementsbyTagName("a").item(g).click
g=200
Endif
g=g+1
loop