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

Kendo daterangepicker from single input field

2 Answers 853 Views
DateRangePicker
This is a migrated thread and some comments may be shown as answers.
Saravanamanikandan
Top achievements
Rank 1
Saravanamanikandan asked on 26 Jul 2019, 06:35 AM

When we call Kendorangepicker, it enables 2 input fields - start and end dates. Is it possible to open kendorangepicker from single input field and once the ranges are selected, dates should return to the input field like 01-01-2019 - 20-09-2019. 

Thanks,

Saravana MS

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 26 Jul 2019, 03:08 PM
Hello Saravana,

The range date picker must be two inputs. This is why it is initialized from a <div> element and it creates its inputs on its own. By default, those inputs don't have a name attribute, so they won't participate in a POST request. Thus, you could use the change event to collect the current range and put it in a hidden input for your purposes according to your needs.

I also made the following example where I hack the range picker main element to be invisible but to show up on click in a textbox that is later populated: https://dojo.telerik.com/@bratanov/OHikoHaC. I can't say whether this will keep working on a more complex layout and when the page gets scrolled, nor whether some other side effects may come up from it, because it is not a scenario we support or test.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Saravanamanikandan
Top achievements
Rank 1
answered on 29 Jul 2019, 04:29 AM
Thanks Marin.
Tags
DateRangePicker
Asked by
Saravanamanikandan
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Saravanamanikandan
Top achievements
Rank 1
Share this question
or