[英]Get date field value using javascript
im using sharepoint date in my form ,im trying to get the date field using javascript .But I did'nt get anything. 我在表单中使用了共享点日期,我试图使用javascript获取日期字段。但是我什么也没得到。
from f12 i got this input element 从f12我得到了这个输入元素
<input name="ctl00$PlaceHolderMain$ArticleDateSection$ctl01$ArticleDateField$ctl00$ctl00$DateTimeField$DateTimeFieldDate" type="text" value="9/10/2014" maxlength="45" id="ctl00_PlaceHolderMain_ArticleDateSection_ctl01_ArticleDateField_ctl00_ctl00_DateTimeField_DateTimeFieldDate" title="Article Date" class="ms-input" autopostback="0">
and my code 和我的代码
if (document.getElementById("<%=ArticleDateField.ClientID %>").value="") {
alert("Please enter the Date..!!")
document.getElementById("<%=ArticleDateField.ClientID%>").focus();
return false;
}
can you tell me what is the issue. 你能告诉我问题是什么吗?
is there any other method to get the date field. 是否有其他任何方法来获取日期字段。
用作,您缺少=
if (document.getElementById("<%=ArticleDateField.ClientID %>").value == "") {
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.