DateTime按钮单击 [英] DateTime Button click

查看:110
本文介绍了DateTime按钮单击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个MVC项目上工作并将mvc网站作为应用程序。



目前我希望这个按钮弹出一个日历菜单:

I work on a MVC project and make a mvc site as application.

At the moment I want this button to pop up a calender menu:

<a class="calender-button" href="#"><img src="~/Content/images/icon-calendar.png" /></a>





我正在使用 Bootstrap 3 Datepicker

推荐答案

您可以设置一个隐藏的输入,点击它就会显示datetimepicker,如:



HTML:

You can set a hidden input and on click of it show the datetimepicker like:

HTML:
<a class="calender-button" href="#">
   Click Here
</a>
<input type="hidden" id="yourField" />





JS :



JS:


' #yourField')。datetimepicker();
('#yourField').datetimepicker();


' 压延按钮)。13 C lick( function (e){
e.preventDefault();
('.calender-button').click(function (e) { e.preventDefault();


这篇关于DateTime按钮单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆