文本框默认当天日期显示
2014-12-24 17:27
176 查看
//1.定义一个日期函数
function CurentTime()
{
var now = new Date();
var year = now.getFullYear(); //年
var month = now.getMonth() + 1; //月
var day = now.getDate(); //日
var clock = year + "-";
if(month < 10)
clock += "0";
clock += month + "-";
if(day < 10)
clock += "0";
clock += day + "";
return clock;
}
//2.文本框
$("#start").val(CurentTime());
<s:text name="effectdate"></s:text>:</div></td><td colspan="3"><input id="start" type="text" onclick="WdatePicker()" name="systemnotice.startDate"/>
//3.图片效果
//1.定义一个日期函数
function CurentTime()
{
var now = new Date();
var year = now.getFullYear(); //年
var month = now.getMonth() + 1; //月
var day = now.getDate(); //日
var clock = year + "-";
if(month < 10)
clock += "0";
clock += month + "-";
if(day < 10)
clock += "0";
clock += day + "";
return clock;
}
//2.文本框
$("#start").val(CurentTime());
<s:text name="effectdate"></s:text>:</div></td><td colspan="3"><input id="start" type="text" onclick="WdatePicker()" name="systemnotice.startDate"/>
//3.图片效果
相关文章推荐
- 如何显示当天日期
- 文本框实现默认显示单击消失的效果
- 文本框默认文字内容消失显示效果
- js实现默认文本框信息 鼠标点击时没有离开时显示
- 文本框默认显示内容点击后消失的方法
- jQuery里面的datepicker日期控件默认是显示英文的,如何显示中文或其他语言呢?
- 文本框中有默认的文字,写获取焦点和失去焦点的文字显示与消失的效果
- 程序中日期的默认显示格式
- 文本框内默认提示————请输入用户姓名(字体灰色),要求: (1)当文本框获得焦点时,默认提示消失 (2)当文本框失去焦点时,如果没有输入新内容,那么则显示原来的灰色字体内容; 如果有新内容输入则判断,如果长度小于10,则提示“姓名长度应该大于10个字符”
- 文本框特效:获取焦点时自动清除默认文本 失去焦点重新显示默认文字
- datagrid使用replace替换显示页面上MICRO默认的1900-1-1日期
- 【总结】DateTime日期类型格式化显示(转)以及判断输入文本框是否符合日期格式
- 文本框默认文字内容消失显示效果
- VS2005里自带的日历控件实现点击日期显示当天所更新了内容!
- 给近三天(或当天)发布的文章显示红色日期或加上new字或new小图片等
- 给近三天(或当天)发布的文章显示红色日期或加上new字或new小图-织梦CMS
- 利用dedecms给近三天(或当天)发布的文章显示红色日期或加上new字或new小图片
- 文本框特效:获取焦点时自动清除默认文本 失去焦点重新显示默认文字
- 一个js日期选择器。当光标移到文本框时。自动会在文本框的底部显示出来。