You must Sign In to post a response.
  • Category: ASP.NET

    Javascript with asp.net control not working in IE11

    <asp:TextBox TextMode="Number" ID="alcup1" runat="server" ClientIDMode="Static" Height="20px" Width="60px" min="-45"max="45" onwheel="alcupFunction()" onkeyup="alcupFunction()" onkeydown="alcupFunction()" onchange="alcupFunction()"></asp:TextBox>


    function alcupFunction(controlname) {
    var num = document.getElementById('<%=alcup1.ClientID %>').value;
    if (document.getElementById('<%=RepeaterPwr1.ClientID %>').value == 10) {
    if (num < -12) {
    document.getElementById('<%=alcup1.ClientID %>').value = -12;

    document.getElementById('<%=alcup1.ClientID %>').focus();

    return false;

    }
    if (num > 12) {
    document.getElementById('<%=alcup1.ClientID %>').value = 12;

    document.getElementById('<%=alcup1.ClientID %>').focus();
    return false;

    }
    } return true;
    }
    "The above script in working fine with chrome but why not with IE11???????? "
  • #768922
    Hai Neha,
    As I can see in the first look that the function is taking the parameter for the control name but you are not passing any parameter value when it is calling.
    Try to either remove the parameter and then use it, else pass the control value and then use the same function.
    The function can be modified as:

    function alcupFunction()
    {
    var num = document.getElementById('<%=alcup1.ClientID %>').value;
    if (document.getElementById('<%=RepeaterPwr1.ClientID %>').value == 10)
    {
    if (num < -12)
    {
    document.getElementById('<%=alcup1.ClientID %>').value = -12;
    document.getElementById('<%=alcup1.ClientID %>').focus();
    return false;
    }
    if (num > 12)
    {
    document.getElementById('<%=alcup1.ClientID %>').value = 12;
    document.getElementById('<%=alcup1.ClientID %>').focus();
    return false;
    }
    }
    return true;
    }

    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com


Sign In to post your comments