I'm trying to get an old ASP classic project up and running as an ASP.NET webfroms solution and I'm having problems getting the javascript to connect to the ASP controls. Here is the .aspx code:
<asp:TextBox id="groupOwner2" CssClass="textbox" Runat="server" Enabled="False" TextMode="SingleLine"></asp:TextBox>
And the javascript that is supposed to manipulate it looks like this, and is trying to clear the text box:
function OnChange() {
// clear existing data
document.getElementById('<%=groupOwner2.ClientID%>').value = "";}
Originally, the the javascript control reference looked like this:
document.Form1.elements["groupOwner2"]
and that didn't work either (unsurprisingly). I've tried a number of variations on these but nothing has worked and I just get "JavaScript runtime error: Unable to set property 'value' of undefined or null reference" when the script is triggered. For the record, the script is being triggered by another control which is why the onChange() function is not mentioned in the textbox ASP code.
Any input would be appreciated!