...

View Full Version : GetElementsByID or Tag or Name



Nirmalks
10-23-2012, 06:23 AM
Hi All,

I have tried all the possible ways bit nothing seems to be working.

The below is part of a link. We need the click to be initiated for the Log On button. We are finding the button to click by GetElementsByTagName.

style = "width:100%"
href = "javascript:CallSubmit('onLoginNow');"
class = "SAPClass"
onMouseOut = "window.status = '';"
onMouseOver = "window.status = unescape('Log on'); return true;">
Log on


I have the following code configured but it it not working. I tried all the Tags with "Click" method of the object but not working:

aTags=.document.getElementsByTagName('INPUT')
for x = 0 to aTags.length
.document.GetElementsByTagName("INPUT").Item(x).Click()
.document.GetElementsByTagName("INPUT").Item(x).Click
ENDFOR

Thank you for whathever help you provide!
N

devnull69
10-23-2012, 10:54 AM
This is not Javascript so you are in the wrong section

VIPStephan
10-23-2012, 11:06 AM
It was originally posted in the HTML/CSS section and I couldn’t make any sense of this mumbo jumbo but it looked somewhat like JavaScript so I moved it here. What other programming language could that be?

devnull69
10-23-2012, 01:17 PM
With the for/to and end for it looks a lot like BASIC, maybe VBScript ...

Old Pedant
10-23-2012, 10:06 PM
I've never seen any language that used ENDFOR.

vbSCRIPT and BASIC would use NEXT.

But, yes, the FOR would be VBScript. And VBScript would ignore case, so then GetElementsByName would work, as well.

But for the rest of it...

Nirmalks
10-24-2012, 07:16 AM
Sorry for the confusion guys..

It is vbscript.

<a>
The below is part of HTML Page:
style = "width:100%"
href = "javascript:CallSubmit('onLoginNow');"
class = "SAPClass"
onMouseOut = "window.status = '';"
onMouseOver = "window.status = unescape('Log on'); return true;">
Log on
</a>

I need to initiate the click for "OnLoginNow button. I have tried but to no avail.

Thanks for your help



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum