需要在单击textbox时显示日历calendar1,
已有的代码是
load form中放了
this.TextBox2.Attributes.Add("onclick ","ShowCalendar()"); web页中加了
<script language="javascript">
function ShowCalendar()
{
请问这里需要什么语句??
}
</script>
已有的代码是
load form中放了
this.TextBox2.Attributes.Add("onclick ","ShowCalendar()"); web页中加了
<script language="javascript">
function ShowCalendar()
{
请问这里需要什么语句??
}
</script>
document.getElementById("calendar1").style.display=""
<script runat="server"> protected void Page_Load(object sender, EventArgs e)
{
Calendar1.Attributes.Add("style", "display:none");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script>
function Show() {
document.getElementById("<%=Calendar1.ClientID %>").style.display = "";
}
function Hide() {
document.getElementById("<%=Calendar1.ClientID %>").style.display = "none";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="TextBox1" runat="server" onclick="Show()" onblur="Hide()"></asp:TextBox>
<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
</form></body>
</html>
<asp:Calendar ID="Calendar1" runat="server" style="display:none;"></asp:Calendar>js
<script language="javascript">
function ShowCalendar()
{
//请问这里需要什么语句??
document.getElementById("Calendar1").style.display = "block";
}
</script>
JS CODE:
<script language="javascript">
function ShowCalendar()
{
document.getElementById("Calendar1").style.display = "";
}
</script>
protected void Page_Load(object sender, EventArgs e)
{
this.Textbox2.Attributes.Add("onclick ", "ShowCalendar();");
this.Calendar1.Attributes.Add("onclick", "SetValue();");
}JS CODE:
function SetValue()
{
document.getElementById("Textbox2").value = document.getElementById("Calendar1").;
}