Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 803393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:45:13+00:00 2026-05-14T23:45:13+00:00

I want a login page in which if any user types invalid password or

  • 0

I want a login page in which if any user types invalid password or username after clicking submit button, then the user will be displayed an error message on the same page.

What should I have to make this requirement enable? Is this possible with ajax or javascript?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:45:14+00:00Added an answer on May 14, 2026 at 11:45 pm

    Yes, this is possible with Ajax. It’s easiest, frankly, if you use a library like Prototype, jQuery, Closure, etc., because they smooth out browser differences and such for you, and have a lot of built-in functionality.

    For example, here’s a fairly succinct way you can submit a form and look at the response using Ajax with Prototype:

    $('formid').request({
        onSuccess: function(response) {
            // Request succeeded, check result for whether login was valid
        }
    });
    

    (That assumes the form has the id “formid”.)

    Here’s a more complete example, which also shows how you hook into the submission process. You might trigger that code by hooking the submit event on the form and sending the Ajax request instead:

    $('formid').observe('submit', function(event) {
        // Prevent the standard form submission
        event.stop();
    
        // Do it via Ajax instead, including an additional flag telling
        // the server that this is an Ajax call
        this.request({
            parameters: {viaAjax: true},
            onSuccess: function(response) {
                // Request succeeded, check result for whether login was valid
                if (response.responseJSON &&
                    response.responseJSON.loginOkay) {
                    // Login worked!
                }
            }
        });
    });
    

    The above does these things:

    1. Hooks up a Javascript handler for when the user submits the form
    2. Handles that event by cancelling the usual form submission and sending an Ajax call instead
    3. Along with the form data, we also include a viaAjax flag telling the server that we’re sending the form via Ajax

    The server should expect the form to arrive either with or without the viaAjax flag. If the flag is there, it means the browser supports Javascript and the form was submitted that way, and so it should just return a flag telling us whether the login was okay (in the above I’ve assumed it will return JSON-formatted data {"loginOkay": true}, which means it should set the content type to application/json). If the flag isn’t there, Javascript is disabled on the browser and the server should handle the form submission in the normal way, returning a full HTML page. (This business of handling it regardless of whether Javascript is enabled is called “progressive enhancement” or “graceful degradation”.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I want to implement is a simple login page, if user login successfully,
I'm working on a login page, I want the user to see his name
I am developing an application which starts from LoginPage. When user Login then he
I want to implement the user authentication and login page in ASP.NET, I want
i want to do these thing: 1.open the login_view (which is the page user
I want to modify the login page of Sharepoint 2010 to change the normal
When the login page is rendered, I want the Url to be empty. So
In my login page I creat FA cookie. I want to add to it
I've created a login page and registration page and now I want to use
I want to localize / globalize the fields on my Login page. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.