Results 1 to 5 of 5

Thread: How to click select component in a Web page using HTML DOM

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    105

    How to click select component in a Web page using HTML DOM

    Hi all,

    Is there any idea to click the select component of an HTML page programitically

    Here is the HTMT code

    HTML Code:
    <td width="83%" align=left nowrap><font face="Times New Roman, Times, serif"> 
    			<select name=cboPrimary size=1 onChange="RemoveOptionAndSubmit(cboSecondary)" style="width=350px;">
    <option value="003"  >ALLIED BANKING CORPORATION - $ BTB (USD  )</option> 
    <option value="004"  >ALLIED BANKING CORPORATION - PESO BTB (PHP  )</option> 
    <option value="008"  >ALLIED BANKING CORPORATION - PESO DTOD (PHP  )</option> 
    <option value="052"  >BANK OF THE PHILIPPINE ISLAND (USD  )</option> 
    <option value="049"  >BANK OF THE PHILLIPINE ISLAND (PHP  )</option> 
    <option value="179"  >EQUITABLE BANK / PCI (PHP  )</option> 
    <option value="175"  >METRO BANK (PHP  )</option> 
    <option value="176"  >METRO BANK - $ (USD  )</option> 
    <option value="177"  >PHILIPPINE NATIONAL BANK (PHP  )</option> 
    <option value="178"  >PHILIPPINE NATIONAL BANK - $ (USD  )</option> 
              	</select>
              	</font>
    		 </td>
    When one of bank is selected, the branches of that bank will be lsited.

    Now I want to do this process programtically.

    Here I used this code:

    VB Code:
    1. Dim BankIndex as Integer
    2. Dim BankName as String
    3. BankIndex  =  5
    4. browser.Document.getElementById("cboPrimary").selectedIndex = BankIndex

    This code select the expected bank BANK OF THE PHILIPPINE ISLAND (USD )

    But the page not lists the branch of this bank. It still remain wihout any action.

    I also tried with the following code

    VB Code:
    1. browser.Document.getElementById("cboPrimary").click

    But no effect

    Is there any suggession to solve this problem

    With regards,
    Nasreen
    Last edited by nasreen; Feb 12th, 2007 at 12:54 PM. Reason: Spell corret

Posting Permissions

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



Click Here to Expand Forum to Full Width