Home > Uncategorized > Firing an onchange event from a HTMLSelectElement

Firing an onchange event from a HTMLSelectElement

Something I just solved, which alot of people seemed to be stuggling with, is the ability to fire the onchange method of a select
box programatically from .NET (in this case VB.NET)
 
Basically the problem is, if you have a drop down list, stored in a HTMLSelectElement, and you set the selectedIndex propery, the onchange event doesn’t automatically get called. – the same happens in Javascript – but you can’t call onchange() like in Javascript, since it’s a property, not a method.
 
Solution
 
hse.FireEvent("onchange", hse.onchange)
 
where hse is the HTMLSelectelement
 
 
Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: