We help IT Professionals succeed at work.
Get Started

javascript to trigger submit button click does not work on production server

TrialUser asked
Last Modified: 2015-11-15
I have javascript in content page, that calls javascript to trigger a button click when enter is pressed inside a textbox. the code works fine in my developement environment but does not work when published to production server. THis is the url of my production servr:  http://test.paperclipsetc.com/Account/Login

<script lang="javascript" type="text/javascript">

        function jftnSubmit(e) {

            if (e.keyCode == 13) {

                document.getElementById('<%= btnLogin.ClientID %>').click();
             return false;
         window.onload = function () {
            document.getElementById('<%= txtUserName.ClientID %>').focus();
 <input id="txtUserName" autofocus  runat="server" type="text"
                class="form-control" placeholder="Username" maxlength="50" onkeyup="return jftnSubmit(event); " />
<button id="btnLogin" runat="server" class="btn-standard"
                Log In
Watch Question
Most Valuable Expert 2017
This problem has been solved!
Unlock 2 Answers and 17 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE