Call jquery function on "onSelectedIndexChanged"
<p>I have two drop-downs and one text box.
I want to display multiplication of selected values from both the drop-downs.</p>

<p>So i am trying to call a jquery function on "OnSelectedIndexChanged" even of dropdowns. Hoever I am getting error during build in Visual studio.</p>

<p>my code is :</p>

<pre><code>&lt;asp:DropDownList ID="ddlProbability" runat="server" Width="125px" OnSelectedIndexChanged="javascript:calculateRiskFactor();"&gt;
</code></pre>

<p></p>

<p>Errors are: <code>Invalid expression term ':' and
Invalid expression term ')' and some more</code></p>

<p>Is anything wrong with syntax or this is wrong way to call a function?</p>

<p>The whole page code is something like this:</p>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Submit_Risks.aspx.cs" Inherits="Risks_Submit_Risks" MasterPageFile="~/MasterPages/SAPMaster.master" %&gt;
&lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"&gt;&lt;/asp:Content&gt;
&lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"&gt;    
&lt;script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="../Scripts/Validation.js"&gt; &lt;/script&gt;
&lt;div class="container"&gt;
    &lt;div class="contain"&gt;
        &lt;div class="title"&gt;
            Risks&lt;/div&gt;
        &lt;div class="data"&gt;
            &lt;asp:Label runat="server" ID="lblMsg"&gt;&lt;/asp:Label&gt;
            &lt;table class="style1" align="center"&gt;

                &lt;tr&gt;
                    &lt;td class="style2"&gt;
                        Probability (P)
                    &lt;/td&gt;
                    &lt;td class="style3"&gt;
                        &lt;asp:DropDownList ID="ddlProbability" runat="server" Width="125px"&gt;
                        &lt;/asp:DropDownList&gt;
                        &lt;asp:RequiredFieldValidator ID="rfvProbability" runat="server" ControlToValidate="ddlProbability"
                            InitialValue="0" ValidationGroup="vgSubmit" ErrorMessage="Probability" ForeColor="Red"
                            Text="*" SetFocusOnError="True"&gt;&lt;/asp:RequiredFieldValidator&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td class="style2"&gt;
                        Impact (S)
                    &lt;/td&gt;
                    &lt;td class="style3"&gt;
                        &lt;asp:DropDownList ID="ddlImpact" runat="server" Width="125px"&gt;
                        &lt;/asp:DropDownList&gt;
                        &lt;asp:RequiredFieldValidator ID="rfvImpact" runat="server" ControlToValidate="ddlImpact"
                            InitialValue="0" ValidationGroup="vgSubmit" ErrorMessage="Impact" ForeColor="Red"
                            Text="*" SetFocusOnError="True"&gt;&lt;/asp:RequiredFieldValidator&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
    &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p></p>
