Solved

Javascript doesn't work on loginpage

Posted on 2015-02-11
3
69 Views
Last Modified: 2015-03-04
My website has a login-page on which you need to enter your username and password.
All goes well when you click the login-button, you are then redirected to the startwebpage.
However, I also want my visitors to login using enter after entering their username and password.
Therefore I've used Javascript.

Problem is that the Javascript is not executed, probably because you're not logged in yet.
I have Forms Authentication, and my guess is that I have to add something in the web.config like:

   <location path="login.aspx">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>

This does not do the trick, I hope somebody can help me with this.
0
Comment
Question by:adiemeer
3 Comments
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 167 total points
ID: 40604727
JavaScript has nothing to do with whether you are logged in or not, it executes in the browser. Post your JavaScript, it probably has a bug in it.
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 167 total points
ID: 40604781
What type of ASP.NET web site are you working with?

With a web forms web site, there is the Panel.DefaultButton property, that you can use to set the button for the <Enter> key.

Using the DefaultButton Property of a Panel in ASP.NET
http://www.aspnettutorials.com/tutorials/controls/defaultbutton-panel-aspnet/
0
 
LVL 36

Assisted Solution

by:Miguel Oz
Miguel Oz earned 166 total points
ID: 40604889
Did you check that JavaScript is enabled in your browser?
To test it, Just add the noscript tag to your html:
<noscript>Your browser does not support JavaScript!</noscript>
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question