I am hoping to get this fixed, so I have a textbox that's for initials and I want to copy that to the next 26 initial boxes so it's a bit easier for the user.
I want to do this on the Client-Side so I don't use up the performance on the server-side.
The issue I am having is that whenever I call the function that's supposed to copy the text over, somehow disables the textbox, I am unable to type anything in the textbox. Please see the code below, please let me know where I am going wrong!
<script type="text/javascript">
function copyText() {
var UI = document.getElementById("txtinitialOriginal").value;
document.getElementById("initial1").innerHTML = UI;
}
</script>
<input type="text" onkeypress="copyText(); return false" runat="server" id="txtinitialOriginal" style="font-size:20px" />
<asp:TextBox ID="initial1" placeholder="Initial Here" style="float:right" runat="server"></asp:TextBox>
What am I doing wrong?
innerHtmlyou should be setting the value instead.