Page 1 of 1

vb.net html combobox

Posted: Mon Sep 12, 2011 8:45 pm
by M1z23R
This topic was a help, but i need new help with html combobox ...

I have now this combobox on site
Code: Select all
<select id="highscoreOffset" name="highscoreOffset" class="styled">
														<option selected="" value="0">1-100</option>
														<option value="100">101-200</option>
														<option value="200">201-300</option>
														<option value="300">301-400</option>
														<option value="400">401-500</option>
														<option value="500">501-600</option>
														<option value="600">601-700</option>
														<option value="700">701-800</option>
														<option value="800">801-900</option>
														<option value="900">901-1000</option>
														<option value="1000">1001-1100</option>
														<option value="1100">1101-1200</option>
														<option value="1200">1201-1300</option>
														<option value="1300">1301-1400</option>
													</select>
<input type="hidden" name="sort" value="loot">
<input type="hidden" name="searchUser" value="">
When comboboxs item gets changed it refresheses page - reloads table items, i used this topic to set comboboxs item, but nothing reloads :/ Any help ?

Re: vb.net html combobox

Posted: Tue Sep 13, 2011 9:46 am
by mandai
That code will set the selected index. You can use this to set an item's text:
Code: Select all
        Dim element As HtmlElement = WebBrowser1.Document.GetElementById("highscoreOffset")
        element.Children(5).InnerText = "test" 'set the 6th item's text to test

Re: vb.net html combobox

Posted: Tue Sep 13, 2011 10:49 am
by M1z23R
This just changes items text :/ I want to "Invoke" item click or something like that :) I can change index, but no php post is made when i change it with element.setatribute("selectedindex","5")

Re: vb.net html combobox

Posted: Tue Sep 13, 2011 7:09 pm
by mandai
Nothing in the sample code deals with reloading the page/posting data.
You could handle the onChange JavaScript event if you want to do that.

Re: vb.net html combobox

Posted: Tue Sep 13, 2011 8:01 pm
by M1z23R
is that possible with VB ?

Re: vb.net html combobox

Posted: Tue Sep 13, 2011 11:02 pm
by mandai
Yes, that would be simple to do.
You could either insert/assign your own JavaScript function or you could use HtmlElement.RaiseEvent if the element's event already has an attached script.

Re: vb.net html combobox

Posted: Tue Sep 13, 2011 11:41 pm
by M1z23R
can i give you "web form" html code or something ? I really don't know how to do that :/

Re: vb.net html combobox

Posted: Wed Sep 14, 2011 9:33 am
by mandai
You will also need a server side script, plus you will need to define what you are trying to send in the post data.

Re: vb.net html combobox

Posted: Wed Sep 14, 2011 11:11 am
by M1z23R
i didn't mention this at the beggining :/ I am sorry for waste of time :/
I want to make automatic combobox change on already existing site, it has its own scripts and things, i don't want to make one :/ On that site, when i change - user click combobox item, it reloads items in table, but when i use vb to change index, it only changes index and nothing happens, no reload. I think i am now almost :) clear enough, thanks for help in this topic, but i need a way ti invoke event on index change.