I have this:
<input type="password" id="txtPassword" name="txtPassword" />
and I want to do something like this:
var password = document.getElementById("<%= txtPassword.ClientID %>").value();
but it tells me "'txtPassword' is not declared." I've tried this:
var pswd = $find('txtPassword').value();
but I get "'null' is null or not an object. So Then I tried this:
var pswd = $find('txtPassword').value();
but I got the same thing. My input control is located in this mess:
<asp:Panel ID="pnlPassword" style="display: none" runat="server">
<div class="PasswordPopup">
<div id="PopupHeader"> </div>
<div class="Controls">
<center><table><tr>
<td>Please enter your password:</td><td><input type="password" id="txtPassword" name="txtPassword" /></td></tr>
<tr><td> </td>
<td><asp:button name="btnOK" id="btnOK" runat="server" text="OK" /> <asp:button id="btnCancel" runat="server" text="Cancel" /></td></tr></table></center>
</div>
</div>
</asp:Panel>
How can I reference that input control in my javascript function?
Thanks,
Jason
inputcontrol in the markup.