onselectedindexchanged() not being called and confirm box clears text even when cancel button is clicked
<p>I am trying to clear the content of the RadEdiotors when different item is selected from the drop down list. The following script does clear the editors' content when OK is clicked but it also clears the content when even cancle button is clicked in the Confirm box that shows up. What is wrong with the following script? Also,
in code behind, the onselectedindexchanged() event of this dropdown is also not being called when a different item is selecetd from the list.
How do I make it work? Please help.Thanks. </p>

<pre><code>&lt;script type="text/javascript"&gt;

        var showConfirm = 1; 

   function onClientSelectedIndexChanging(item) {
    var editor1 = $find("&lt;%= Editor1.ClientID %&gt;");
    var editor2 = $find("&lt;%= Editor2.ClientID %&gt;");
    var content= editor.get_html();  
    var callBackFn = function (arg) 
    { 
        if (arg == true &amp;&amp; showConfirm == 1) 
        { 
            var combo = item.ComboBox; 
            combo.ClearSelection(); 

            showConfirm = 0; 

            combo.FindItemByText(item.Text).Select(); 
            combo.SetText(item.Text); 

            __doPostBack("cboxLanguage", '{\"Command\":\"Select\"}'); 

            showConfirm = 1;             
        } 
    }


    if (showConfirm == 1 &amp;&amp; content != '') 
    {

        confirm('Changing the language will clear the content of the ediotrs. Click OK to proceed.', callBackFn);

        alert(confirm);
         if (content != null) 

         {
                 editor1.set_html("");
                 editor2.set_html("");
                 return true
          }
          else 
          {
              return false;
          } 
    } 
    return false; 
} 
&lt;/script&gt; 
</code></pre>

<p>Its telerik's Radcombobox that I am using and RadEditor.</p>

<p>This is my combobox :-</p>

<pre><code>   &lt;telerik:RadComboBox ID="cboxLanguage" TabIndex="2" runat="server" AutoPostBack="false" OnSelectedIndexChanged="cboxLanguage_OnSelectedIndexChanged" OnClientSelectedIndexChanging="onClientSelectedIndexChanging"&gt;
&lt;/telerik:RadComboBox&gt; 
</code></pre>

<p><strong>I want if confirm==true then clear editors' content otherwise not. How do I get the "true" value of this confirm box? Also, how do I get the OnSelectedIndexChanged() event to be called?</strong></p>

<p>Can anyone please help? What am I doing wrong here?</p>

<p>edit
alert(confirm); returns the complete function code. How do I fetch the true/false values and clear editors' content based on that?</p>
