joezimo
Junior Member
Posts: 2
Registered: 12/9/2005
Location: Buffalo, NY
Member Is Offline
|
| posted on 12/9/2005 at 08:03 PM |
|
|
Pass Date to TextBox in asp.net
Sorry for the newbie question, I'm trying to learn. I've got the calendar working well, but I need to pass the date to TextBox1 on my page, not the
'input1' that came with the example. I've looked at this forum, but can't get it to work. My code:
<HTML>
<HEAD>
<title>calendar</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script language="JavaScript" src="calendar2.js"></script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<p>
<a href="javascript:cal1.popup();">Click here</a>
</p>
<asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 40px" runat="server"></asp:TextBox>
<asp:LinkButton id="lnkHome" style="Z-INDEX: 103; LEFT: 16px; POSITION: absolute; TOP: 112px"
runat="server">Home</asp:LinkButton>
</form>
<script language="javascript">
var cal1 = new calendar2(document.forms['Form1'].elements[0]);
</script>
</body>
</HTML>
I know the var statement is not correct, so if anyone can direct me on how to do this, I would greatly appreciate it.
Joe
|
|
|
joezimo
Junior Member
Posts: 2
Registered: 12/9/2005
Location: Buffalo, NY
Member Is Offline
|
| posted on 12/9/2005 at 08:25 PM |
|
|
Ok, I went to asp.net forum and found the solution. I had to change the var statment:
var cal1 = new calendar2(document.forms['Form1'].TextBox1);
Hope this helps someone!
Joe
|
|
|