Munna Sarfraz

Munna Sarfraz

  • NA
  • 6
  • 11.6k

Not able to attach Handler on Listboxes in case of OnChange event already fired on java script code

Dec 26 2008 6:26 AM

I am developing Test Recorder/Playback tool in C# Language.

Tool able to record and playback some application perfectly, but facing issues in case of source code also having onchange event.

 

We are attaching handler for recording the script, basically OnClick for Textbox, OnChange for Dropdown list,

Right now I am facing issue with Dropdown list,

Source code of Dropdown List is:  See the code in select tag also onchange event is here.

<select onblur="setCustDirtyFlag();" id="custType" id="custType" style="z-index:1" onchange="changeCreateCustCustType();">

    <option value="A">A</option>

    <option value="B">B</option>

    <option value="C">C</option>

</select>

 

C# Code:

oHTMLSelectElement.HTMLSelectElementEvents2_Event_onchange += new mshtml.HTMLSelectElementEvents2_onchangeEventHandler(ListBox_onchange);

 

private void ListBox_onchange(mshtml.IHTMLEventObj e)

{

      IsSelectElementOnChange=true;

      DocumentClick(e.srcElement, false);

}

 

Actually we are attaching Handler to ListBox on OnChange Event, But problem is that in source code also calling function on onchange event.

 

As per my assumption both functions is conflecting.

 

So handler is not working, Please provide sollution

 

-Regrds,
Sarfraz