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
 
 
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment