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

how do I clear RADDateInput on the client?

3 Answers 84 Views
Input
This is a migrated thread and some comments may be shown as answers.
Elliott
Top achievements
Rank 2
Elliott asked on 04 May 2012, 02:15 PM
I've been trying to clear a bad date in Javascript
<telerik:RadDateInput id="del1" DateFormat="d" Width="82px" Height="18px" Font-Size="X-Small" Font-Names="Verdana" BorderWidth="1px" AllowEmpty="true" runat="server" >
    <ClientEvents OnKeyPress="del_keypress" />
    <ClientEvents OnError="date_input_error" />  
</telerik:RadDateInput>
the scripts
function del_keypress(sender, eventArgs) {
    var whichCode = eventArgs.get_keyCode();
    if ((whichCode != 13) && ((whichCode < 47) || (whichCode > 57)))
        eventArgs.set_cancel(true);
}
 
function date_input_error(sender, args) {
    alert("Invalid Delivery Date");
   // next line does nothing
    sender.clear();
    sender.focus();
}

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 May 2012, 10:32 AM
Hello Marianne,

I also experienced the same behavior in the latest version(2012, 1, 411, 35). It was figured out as a bug according to this forum thread.

Thanks,
Shinu.
0
Elliott
Top achievements
Rank 2
answered on 07 May 2012, 02:19 PM
thanks Shinu
unfortunately, Remus beat me to it, so he gets the points

I wonder if the locking that happens on Firefox is part of the problem - or separate
0
Vasil
Telerik team
answered on 08 May 2012, 08:03 AM
Hi Shinu,

The two issues are way different, the forum you linked is about problem in server side of the control, that happens after postback with invalid value. I think it is already fixed and it should work correctly in the current official version.

The actual issue that Marianne experience is caused by a JavaScript bug and it happens only in single input rendering mode. It will be resolved in the next release.

All the best,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Input
Asked by
Elliott
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Elliott
Top achievements
Rank 2
Vasil
Telerik team
Share this question
or