c# - Fire TextChanged for textbox when the text changed by javascript -
i have text box i'm filling of date jquery datepicker , code below:
<div id="test"></div> <asp:textbox id="txtrdate" runat="server" width="120px" clientidmode="static" autopostback="true" ontextchanged="txtrdate_textchanged"> </asp:textbox>
javascript code is:
<script type="text/javascript"> $('#test').datepicker({ dateformat: 'yy/mm/dd', mindate: new date(2017, 1, 1), defaultdate: new date(), onselect: function(date, obj){ $('#txtrdate').val(date); //updates value of date } }); </script>
when select date datepicker text changed on textbox textchanged
textbox not fired.
c# code behind:
protected void txtrdate_textchanged(object sender, eventargs e) { getdata(txtrdate.text); }
kindly advise me how fire textchanged textbox when text changed javascript
thanks in advance.
in jquery .val() not trigger onchange have trigger it
<script type="text/javascript"> $('#test').datepicker({ dateformat: 'yy/mm/dd', mindate: new date(2017, 1, 1), defaultdate: new date(), onselect: function(date, obj){ $('#txtrdate').val(date); //updates value of date $('#txtrdate').trigger('change'); } }); </script>
Comments
Post a Comment