0
在我的表單中我有一個文本框,並與其他控件<使用Javascript顯示屬性
<asp:TextBox ID="TextBox2" runat="server" onfocus="CalOpen()" asp:TextBox>
<asp:Calendar ID="Calendar1" runat="server" style="display:none;"
onselectionchanged="Calendar1_SelectionChanged"></asp:Calendar>
<script type="text/javascript">
function CalOpen()
{
var cal = document.getElementById('<%=Calendar1.ClientID%>');
cal.style.display='block';
}
</script>
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
TextBox2.Text = Calendar1.SelectedDate.ToLongDateString();
Calendar1.Visible = false;
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
Calendar1.Visible = true;
}
第一次當我點擊TextBox2中它工作得很好, 但是,第二次沿着calendr,也就是說,後第一次選擇日期。 瀏覽器拋出錯誤「object required」
我無法知道我出錯的地方。
Plz幫助我使我的代碼正確。
謝謝。
非常感謝你。 – Gokul 2010-04-28 14:56:24