Hi all,
I am trying to change the selection in a html dropdown menu within a form with <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">vba</acronym> in order to collect information.
webpage: http://www.sea-distances.org/
Here is what I have:
The HTML:
Problem: The dropdown menu dos't change.
Thanks for your help
I am trying to change the selection in a html dropdown menu within a form with <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">vba</acronym> in order to collect information.
webpage: http://www.sea-distances.org/
Here is what I have:
Code:
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application") 'Set IE = InternetExplorer
IE.Visible = True 'Set InternetExplorer to Visible
IE.Navigate "http://www.sea-distances.org/" 'Load web page
'Run and Wait, if you intend on passing variables at a later stage
Do While IE.Busy
DoEvents
Loop
Do While IE.readyState <> 4
DoEvents
Loop
IE.document.getElementById("country_id_from").Focus
IE.document.getElementById("country_id_from").selectedIndex = 1
IE.document.getElementById("country_id_from").FireEvent ("onchange")
The HTML:
HTML:
<form class="form-vertical" id="verticalForm" action="/" method="post"> <div class="span6"> <div class="row"> <div class="port span3 pull-left" id="pfrom2"> <h4>Port of Departure</h4> <label>Country</label> <select class="span3" name="country_id_from" id="country_id_from"><option value="">select country</option><option value="0001" data-image="/flags/blank.gif" data-imagecss="eflag f1">Albania</option><option value="0002" data-image="/flags/blank.gif" data-imagecss="eflag f2">Algeria</option><option value="0004" data-image="/flags/blank.gif" data-imagecss="eflag f4">Angola</option><option value="0005" data-image="/flags/blank.gif" data-imagecss="eflag f5">Antigua</option><option value="0006" data-image="/flags/blank.gif" data-imagecss="eflag f6">Argentina</option><option value="0007" data-image="/flags/blank.gif" data-imagecss="eflag f7">Aruba</option>
Problem: The dropdown menu dos't change.
Thanks for your help