DataList and <asp:textbox> issues!

andycharger

Centurion
Joined
Apr 2, 2003
Messages
152
I have got around my date problem from earlier by building a calendar function.
However, when im creating dates on a normal webform, everything is fine. I can use <asp:textbox> in the webform to pass my value to.

However, if im editing my data at a later date, I pass my data to a DATALIST.

This seems to be an issue because when I press my calendar, the javascript error pops up and says Error: document.forms().elements.Value is null or not an object.
I think this is because you cannot use <asp:textbox> in a datalist.

Firstly, Am I Right?

Secondly, is there a work around for this or can I use an alternative way of showing my stored data instead of a datalist that will allow me to use asp:textbox?
 
Are you calling client side javascript to the textbox?

If so theres a way to do it... but I won't post the code unless thats what you want.
 
Yes it is client side javascript ( think)

Here is my code on my page. It works fine when im not inside the datalist on my newcomplaint.aspx page.
However, when im on the editcompaint.aspx page and im retrieving data and putting it in a datalist, it has problems.
Basically its going to record complaints with lots of dates in them (when customers responded, etc) so It needs to allow users to go into the form again (using the datalist info) and change the dates.

Help!!!

<td colspan="2" class="normaltext" align="left"><asp:TextBox enabled=False CssClass="boxtext" ID=txtDateRec Runat=server><%# DataBinder.Eval(Container.DataItem, "date_comp_rec") %></asp:TextBox><a href="javascript:OpenCalendar('txtDateRec', false)"><img height="16" src="icon-calendar.gif" width="24" align="absMiddle" border="0" ></a></td>


If you want to know what app im using the one from here:
http://www.igluon.net/codecenter/popup_calendar.zip

and an example is here:
http://www.igluon.net/popup_calendar/testform.aspx
 
Back
Top