programmatically select an option in dropdown

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • balu435
    New Member
    • Jan 2007
    • 13

    programmatically select an option in dropdown

    Hi friends,

    I have an (VBA) application which programatically fills the values in a web page.
    In the web page there is a dropdown menu whose options are selected during run-time by using a function.Is there anyway by which I can select the option in the dropdown menu programatically ?
    If the dropdown menu in the web page had its options explicitily mentioned (like <option value="1">1</option>...) I could have used document.form.o bjectname.selec tedindex=n in the VBA code.
    But here all I have is a function to generate the values in the dropdown menu.
    like...
    <select name="name" id= "">
    print_month_ele ment_drop_down_ menu(1, 12, 2, ' ');
    </select>
    Is there a wayout to select the desired value programmaticall y from my VBA application?

    (I am temporarily using the sendkeys method,but it isnt that gr8 a solution...:-))

    Regards,
    Balu435
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Moved your question to asp so that you might get a better chance at an answer

    Comment

    • balu435
      New Member
      • Jan 2007
      • 13

      #3
      Originally posted by willakawill
      Moved your question to asp so that you might get a better chance at an answer
      ok...I hope I would get the logic...
      .thanks..:-)

      Comment

      • balu435
        New Member
        • Jan 2007
        • 13

        #4
        Originally posted by balu435
        ok...I hope I would get the logic...
        .thanks..:-)
        Hi..
        Its working now..
        I gave the code as document.form.o bject.selectedi ndex.=n
        where n is the index of the required value..
        I dont understand if it can get so simple..anyway its working..:-)

        Comment

        Working...