browser - How to select drop down value - Vb.net Webbrowser -


i want select dropdown value vb.net webbrowser

<option value=1>one</option>  <option value=2>two</option> 

the values 1 & 2 without quotes

if value within quotes such value = "1"

then can use code

webbrowser1.document.getelementbyid("id").setattribute("value", "1") 

but not work above.

thanks in advance.

actually not matter if there quote or not. created test code , seems working.

for each frame htmlwindow in currentwindow.frames   dim btnelementcollection htmlelementcollection =                   frame.document.getelementsbytagname("select")     each curelement htmlelement in btnelementcollection       dim controlname string = curelement.getattribute("id").tostring       if controlname = textbox2.text         curelement.setattribute("value", textbox3.text)       end if     next next                                                                                       textbox2 id textbox3 value 

sorry, not sure why didn't work first time , everyones time.

try setting attribute name uppercase.

<option value=1>one</option>  <option value=2>two</option> 

note "value" "value"


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -