Basically I am creating a simple function in javascript to check if a textbox value has changed from what it was originally and if so to warn the user the impact the change will have. If the user clicks yes, do nothing, if they click no then I want to set the value of the textbox back to the original value it should be for them.
EDIT
Okay it seems I was mistaken as to the root of the problem. It seems that the inpUsername which is a hidden input I have is blank from the beginning. How do I set it correctly in the asp portion of the code so it takes the value of another textbox on the same control?
I currently have:
<input type="hidden" id="inpUsername" runat="server" value=
%#DataBinder.Eval(Container.DataItem,"txtUsername")%> />
This returns the error: BC30456: ‘DataItem’ is not a member of ‘System.Web.UI.Control’. However if I add additional quotes around the value it outputs “/> to the screen
The txtUsername declaration as requested is:
<asp:TextBox ID="txtUsername" runat="server" CssClass="Textbox" Style="width:100%"
onchange="checkForUsernameChange()"/>
There’s some spaces before the ID. I’m pretty sure you wanted :
Or maybe the spaces were intended, in which case the
confirmshould also include those spaces.