Having trouble getting help?
Contact Support
Contact Support
Open the DatePicker popup upon focusing input of DatePicker
24 Mar 20221 minute to read
You can open the DatePicker popup on input focus by calling the show
method in the input focus
event.
<ejs-datepicker id="datepicker" focus="onFocus" placeholder="Choose a Date"></ejs-datepicker>
<script>
function onFocus (args) {
var datepickerObject = document.getElementById("datepicker").ej2_instances[0];
datepickerObject.show();
}
</script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace EJ2CoreSampleBrowser.Controllers
{
public class HomeController: Controller
{
public ActionResult sample()
{
ViewBag.value = new DateTime(DateTime.Now.Year,DateTime.Now.Month,14);
return View();
}
}
}