<script type="text/javascript">
function ddl_Changed(that)
{
row=$("#"+that.id).parents("tr");
memberRate = row.children("td:eq(2)").children(".selectbox").val();
pmgrRate = row.children("td:eq(3)").children(".selectbox").val();
pdirRate = row.children("td:eq(4)").children(".selectbox").val();
if(memberRate=="")
memberRate = 0
else
memberRate = memberRate*1;
if(pmgrRate=="")
pmgrRate = 0
else
pmgrRate = pmgrRate*1;
if(pdirRate=="")
pdirRate = 0
else
pdirRate = pdirRate*1;
row.children("td:eq(5)").children(".txtTotalRate").val(memberRate+pmgrRate+pdirRate);
}
</script>
DataBound da
rptddlMemberRate.Attributes.Add("onchange", "ddl_Changed(this);");
rptddlPmgrRate.Attributes.Add("onchange", "ddl_Changed(this);");
rptddlPdirRate.Attributes.Add("onchange", "ddl_Changed(this);");
grid de de textbox
<asp:TextBox ID="txtTotalRate" runat="server" CssClass="txtTotalRate" Style="display: none;"></asp:TextBox>
bu kod
3 dropdown list te 0 dan 45 e kadar 5 in katı rakamlar 3 dropdown list ten secilen degeri textbox a ekliyor.
javascriptte dikkat et td lerden yakaliyorum.
|