Getting the value of object's Element from a webpage

Discussion in 'JavaScript' started by robinsridhar, Jun 28, 2008.

  1. #1
    How to get the value of object's element from a webpage where object name or id is not given. Does any body have clue for me. Even any working code could be accepted.

    I have a two frames in browser

    1. My Own (name="topFrame" id="topFrame")
    2. Third Party Web Page (name="bottomFrame" id="bottomFrame")

    So the Javascript code is running in top frame.

    In bottom frame I am loading a third party webpage url which have a currency conversion calculator form with no name or id attribute mentioned ( <form action="" method=""> and not <form name="calculatecurrency"> or <form id="calculatecurrency"> )

    There are following form elements which exist in this form:

    Select Source Currency from Select List ( list name="srcCurr" id="srcCurr")
    Select Target Currency from Select List ( list name="tgtCurr" id="tgtCurr")
    Enter Amount in Source Currency in a Text Field (textfield name="srcAmt" id="srcAmt")
    and Then There is a button called "Currency Calculator"

    So once I submit that form, It shows the Target Currency in the webpage.

    I need to capture this Target Currency.

    So How I can go about it?

    I require it urgent for my application.

    Thanks a lot in advance.

    Regards
    Robin Sridhar
    robinsridhar@gmail.com
     
    robinsridhar, Jun 28, 2008 IP
  2. yugolancer

    yugolancer Well-Known Member

    Messages:
    320
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #2
    var element = document.getElementsByTagName("object");
    Code (markup):
    If i remember well this will return the 1st object element in the current document/frame even if hasn't assigned ID or Name attribute. Give it a try!:)
     
    yugolancer, Jun 28, 2008 IP