The mentioned HTML and JS code working in chrome but not in IE

41 Views Asked by At

function textcomment() 
{
           commentf.value = document.getElementById('chkComm').value;}
   <asp:Label ID="llbcom" runat="server" CssClass="NormalSmallText" AssociatedControlID="chkComm" Visible="False">Reason for Request<FONT class="Asterisk" >*</FONT></asp:Label>

  <asp:TextBox ID="chkComm" runat="server" CssClass="NormalSmallText" onchange="textcomment();"
                        Width="100%" Rows="4" Visible="False" textmode="MultiLine"></asp:TextBox>
                        

<input id="commentf" type="hidden" name="commentf" runat="server" />

1

There are 1 best solutions below

0
Deepak-MSFT On

I suggest you try to make a test with an example below. It is working fine in the IE 11 browser.

Code:

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
    function getValue() {
        var getVal = document.getElementById('<%= txt_id.ClientID %>').value;        
        document.getElementById('t1').value = getVal;
        alert(document.getElementById('t1').value);
    }
    </script>

     <asp:TextBox ID="txt_id" runat="server" onChange="getValue()" AutoPostBack="True" ></asp:TextBox>
      <br />
     <input type="hidden" id="t1" value="123">
</asp:Content>

Output:

enter image description here