Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    GetElementsByID or Tag or Name

    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

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    This is not Javascript so you are in the wrong section

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,797
    Thanks
    6
    Thanked 1,023 Times in 996 Posts
    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?

  • #4
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    With the for/to and end for it looks a lot like BASIC, maybe VBScript ...

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,695
    Thanks
    80
    Thanked 4,511 Times in 4,475 Posts
    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...
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #6
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •