This is a migrated thread and some comments may be shown as answers.

Enable asp button on RadCombobox and RadDatePicker

4 Answers 71 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Salman
Top achievements
Rank 1
Salman asked on 22 Feb 2016, 07:46 AM

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");
    });

4 Answers, 1 is accepted

Sort by
0
Salman
Top achievements
Rank 1
answered on 25 Feb 2016, 06:07 AM
What I need is what could be used as alternative for 'keyup' and 'change ' when we have RadCombobox and RadDatePicker
0
Eyup
Telerik team
answered on 25 Feb 2016, 06:38 AM
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
0
Salman
Top achievements
Rank 1
answered on 29 Feb 2016, 08:37 AM

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.

 

0
Eyup
Telerik team
answered on 03 Mar 2016, 07:12 AM
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
Tags
ComboBox
Asked by
Salman
Top achievements
Rank 1
Answers by
Salman
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or