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 4075492
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:18:18+00:00 2026-05-20T17:18:18+00:00

<form id=login_frm method=post action = /login/user_auth/> <fieldset> <legend>Login:</legend> <label for=id_email>Email</label> <input type=text name=email id=id_email

  • 0
<form id="login_frm" method="post" action = "/login/user_auth/"> 
    <fieldset> 
    <legend>Login:</legend> 
        <label for="id_email">Email</label> 
        <input type="text" name="email" id="id_email" /> 

        <label for="id_password">Password</label> 
        <input type="password" name="password" id="id_password" /> 

    </fieldset> 
    <input name = "login" type="submit" value="Login" /> 
</form> 


$(document).ready(function () {
    $('#login_frm').submit(function() {
            var $form = $(this);
            $.post('/login/user_auth/' , form.serialize(), function(data) {
               // alert ("function");
        alert (data);
    });
    return false;
    });
});

Django View:

def login_user(request):
    if request.method == 'POST':
        # perform all logic / and db access
    data = "hello"
    return HttpResponse(data)
    # return HttpResponse ('success.html')

I have been stuck on this all afternoon.

  1. When I return data as my response, for some reason, the browser displays “Hello” by loading a blank webpage with just “Hello” written on it; in the JavaScript function above, alert (data); is never called (I cannot understand why).

  2. I am unable to render the success.html. I believe that if I write render_to_response inside the HttpResponse, I will solve this problem. However I think making point 1 work is a first priority.

Goal

After the post, I would like to capture the returned response from the server (whether it is just the “hello” message, or a webpage that displays a success message- stored in “success.html”) and display it in place of the login_frm without having the browser refresh a new webpage.

  • 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-20T17:18:19+00:00Added an answer on May 20, 2026 at 5:18 pm

    Interesting. form is undefined (you defined it as $form) and changing to $form fixed the problem.

    $(document).ready(function () {
        $('#login_frm').submit(function() {
            var $form = $(this);
            $.post('/login/user_auth/' , $form.serialize(), function(data) {
               // alert ("function");
               alert (data);
           });
        return false;
        });
    });
    

    You might want to use something like event.preventDefault() so that future errors are not hidden from you like this. $('form').submit(function(e){ e.preventDefault(); .....})

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

Sidebar

Related Questions

I have a login page as follows: <form action=? method=post id=frm-useracc-login name=frm-useracc-login > <div
I have following code: div.accountPage div.acct-form.login div.acct-header Log-in form.loginForm.login input(id=username, type=text, name=User, placeholder=Username, value=)
Login Form: $authAdapter = Zend_Registry::get('authAdapter'); $authAdapter ->setIdentity($formData['email']) ->setCredential($password) ->setCredential(1); Bootstrap: protected function _initAuth(){ $this->bootstrap('db');
I have a login form for my website. This login form have two text
$(document).ready(function() { $(form#login_form).submit(function() { var login_username = $('#login_username').attr('value'); var login_password = $('#login_password').attr('value'); type: POST,
my jquery validation form is not validate ..here is the code like <script type='text/javascript'>
I am using the.load function and I am having some trouble: <form id=register_frm method=post
I have a simple form that posts to an HttpPost action method, which returns
<script language='javascript' type='text/javascript' charset='<?=$page_charset?>'> $(document).ready(function(){ $('#btn_login').click(function(){ $.search_keyword(); }); }); here is the script <form
try create form login in Sencha Touch 2.1 ... xtype: 'fieldset', title: 'My Login',

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.