Welcome Guest Search | Active Topics | Sign In | Register

WebBrowser: How to set selected value Options
Sergio
Posted: Monday, March 30, 2015 3:54:14 PM
Rank: Newbie
Groups: Member

Joined: 3/21/2015
Posts: 8
Hi

Here is my combo

<select name="ctl00$MainContent$CldFecha$DdlAnio" id="DdlAnio" class="calendarCombo2" onchange="ValidateYear();" style="width: 80px; display: none;" sb="48324249">
<option value="2011">2011</option>
<option value="2012">2012</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
<option selected="selected" value="2015">2015</option>

</select>

I'am trying to set value this way

webView1.EvalScript("document.getElementsByName('ctl00$MainContent$CldFecha$DdlAnio')[0].value = '2014';");
webView1.EvalScript("document.getElementsByName('ctl00$MainContent$CldFecha$DdlAnio').change();");

but don't work

whats wrong?

eo_support
Posted: Tuesday, March 31, 2015 9:29:00 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

This usually is because you have some problem with your JavaScript code. You can try to run the same script you are trying to run in Google Chrome's developer tool script console, or you can use our TabbedBrowser console feature and it should help you find out if there is any problem with your script code. We are not in a position to debug your JavaScript code for you.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.