Enable asp button on RadCombobox and RadDatePicker

5 posts, 0 answers
  1. Salman
    Salman avatar
    6 posts
    Member since:
    Feb 2016

    Posted 22 Feb Link to this post

    In a form, I have both RadComboBox and RadDatePicker and I want to enable an asp button if any change is made to them. How I can make it possible.

    I use below code for textboxes and it's working fine:

    $(document).ready(function () {
     
        $("#BtnUpdate").attr('disabled', 'disabled');
     
        $("input.UpdateCSS").keyup(function () {
            $("#BtnUpdate").removeAttr('disabled');
        });
     
     
     
        $("input.UpdateCSS").change(function () {
            $("#BtnUpdate").removeAttr("disabled");
        });

  2. Salman
    Salman avatar
    6 posts
    Member since:
    Feb 2016

    Posted 25 Feb Link to this post

    What I need is what could be used as alternative for 'keyup' and 'change ' when we have RadCombobox and RadDatePicker
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 25 Feb Link to this post

    Hi Salman,

    You can leverage the following event handlers to achieve this requirement:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/combobox/client-side-programming/events/onclientselectedindexchanged
    http://docs.telerik.com/devtools/aspnet-ajax/controls/datepicker/client-side-programming/events/ondateselected

    Also, you can try replacing your regular button with RadButton, which provides set_enabled() method:
    http://www.telerik.com/forums/set-enabled-disabled-radbutton-from-client-side#lyZcctMUUUmR1h8J2XA8ZA

    I hope this will prove helpful.

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Salman
    Salman avatar
    6 posts
    Member since:
    Feb 2016

    Posted 29 Feb Link to this post

    Hi Eyup,

    Thanks for your reply.

    the solution works perfectly for RadCombobox.

    For RadDatePicker, ondateselected is not what I'm looking as the event triggered when Datepicker has a value which for my case, it has a default value (I'm looking for an event to detect change). Like onclientselectindexchanged, I'm looking for a client-side event or a workaround to solve the issue.

     

  6. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 03 Mar Link to this post

    Hello Salman,

    In this case, you can try using the ValueChanged event handler of the date input:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/input/client-side-programming/events/overview

    Here is a demonstration:
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server">
        <DateInput runat="server">
            <ClientEvents OnValueChanged="yourHandlerName" />
        </DateInput>
    </telerik:RadDatePicker>

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017