read javascript select options into Delphi
27. Jan 2008, 22:19
I receive a web page which has javascript in it.
<select name="region52708" class="popup" onchange="javascript:selectRegion(5270">
<option value=""></option>
<option selected value="N America">N America</option>
<option value="Asia">Asia</option>
<option value="Europe">Europe</option>
<option value="Global">Global</option>
<option value="S America">S America</option>
<option value="Africa">Africa</option>
</select>
I want to copy the select option values from the select statement in javascript using IE as browser. I use Delphi 7 and TWebBrowser.
ovElements.item(i).name points at the select belonging to region52708
I try this:
for j := 0 to ovElements.item(i).options.length-1 do begin
Memo1.lines.add('option ' + inttostr(j) + ' ' + ovElements.item(i).options[j].value;
end;
The syntax is not correct.
Is someone able to point me at the correct way to make the options from the script visible in Delphi?
Thanks in advance.
Regards,
Franz
|