Hi, Mike,
Setting the property Visible to false prevents the control from being
rendered to the page output (that's the case with Label1).
I'd change the <input type=text"> with an <asp:textbox runat="server"
readonly="true"/> and read the value on the postback.
Hope this helps
Martin
"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:78**********************************@microsof t.com...
Hi,
I am developing a JavaScript calendar control. I want my user control to
expose a property that returns the value of the selected calendar date. I
have an "input" control that displays the selected date. I also tried to
add a Label server-side control, but I am unable to set its value through
Javascript.
<form id="mainForm" name="mainForm" action="" method="post">
<p>
<input id="fullDate" type="text" disabled maxLength="9" size="9"
name="fullDate">
<input id="showit" onclick="showCalendar(event)" type="button">
</p>
<asp:Label id="Label1" runat="server" Visible="false">Label</asp:Label>
</form>
function chooseDate(day, month, year) {
document.getElementById("fullDate").innerText = day + "/" + month + "/" +
year;
document.getElementById("Label1").innerText = day + "/" + month + "/" +
year; //fails
hide("calendar");
}
Is there a solution to this?
Thanks
Mike