zoidberg84
Programmer
hello, i am trying to create a user input form that links to a database, everything is working fine apart from one problem... There is a field called "DateJoined" and i want the page to load with the current system date already in the dateJoinedTextBox!
I am writing in ASP.net 2.0 using Access as my DBMS!!
so far i have worked out aq way to get just the date using a javascript function:
but i cant get it into my text box in anyway cos it won't allow code between the <asp:textbox> tags and i am using templateFileds but am not sure how to do it!?
code for DateJoined TemplateField:
any help would be great!
I am writing in ASP.net 2.0 using Access as my DBMS!!
so far i have worked out aq way to get just the date using a javascript function:
Code:
<script type="text/javascript">
var currentTime = new Date()
var day = currentTime.getDate()
var month = currentTime.getMonth() + 1
var year = currentTime.getFullYear()
document.write(day + "/" + month + "/" + year)
</script>
but i cant get it into my text box in anyway cos it won't allow code between the <asp:textbox> tags and i am using templateFileds but am not sure how to do it!?
code for DateJoined TemplateField:
Code:
<asp:TemplateField HeaderText="Date Joined">
<InsertItemTemplate>
<asp:TextBox ID="dateJoinedTextBox" runat="server" Text='<%# Bind("DateJoined") %>'></asp:TextBox><br />
</InsertItemTemplate>
</asp:TemplateField>
any help would be great!