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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:53:46+00:00 2026-06-14T19:53:46+00:00

I want to edit the error message outside of the validate function. So I

  • 0

I want to edit the error message outside of the validate function. So I have a simple password recovery form. Here’s the html:

<div style="position:relative; left:40%;" class="pass_recovery">
    <h2 class="title">Recover</h2>
    <form action="" method="POST" id="recover_pass">
        <span style="font-size:12px;">Email you registered with: </span><input type="text" name="recov_pass" id="recov_pass"<br>
        <input type="submit" value="Send Password">
    </form><br>
</div>

And here’s my jquery for the validation:

var pass_rec = $('#recover_pass').validate({
    onkeyup: false,
    errorClass: "password_messages",
    rules: {
        recov_pass: {
            required: true,
            email: true
        }
    },
    messages: {
        recov_pass: {
            required: "Please enter an email address",
            email: "Please enter a valid email address"
        }
    }
});

And then the ajax call. This simply checks if the inputted email is a valid, registered email address.

$('#recover_pass').submit(function() {
    if(pass_rec.form()) {
        var $this = $(this);  
        $.ajax({
            data: $this.serialize(), // get the form data
            type: "POST", // GET or POST
            url: "Private/Recover_pass.php", // the file to call
            success: function(data) { // on success..
                if(data=="pass") { 
                    $('.password_messages').text('good');
                }
                else {
                    $('.password_messages').text('bad');
                }
            },
            error: function(data) {
                $('.password_messages').text('error');
            },
            complete: function(data) {
                $('#recov_pass').val("");
            }
        });
    }
    return false; //so it doesn't refresh when submitting the page
});

This doesn’t work because when I entered in a dummy email that isn’t registered, say example@ex.com, then it doesn’t display the bad message. How do I show the error message outside of the validation function?

  • 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-06-14T19:53:47+00:00Added an answer on June 14, 2026 at 7:53 pm

    You are trying to put the result string into an area on your page that has a class of ‘.password_messages’ but I do not see that in your html example code. Are you sure it is somewhere on your page?

    You should have a target like:

    <span class='.password_messages'></span>
    

    and that is where you would expect to see the result text, right?

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

Sidebar

Related Questions

I want to edit the css of a div element during .resize() event and
How do I render form_for error messages outside of the form_for div? This is
How do I get error message from webmethod, I want to initiate error. Also,
EDIT ive got it almost, having and error message now that it can't find
I'm trying to use the Jquery validation plugin to validate my form. I have
I'm using sfGuard plugin for Doctrine. I want to override the default error message
I want to spawn another process to display an error message asynchronously while the
Given a sequence of eithers Seq[Either[String,A]] with Left being an error message. I want
I just want to have ablility to edit class properties whish is not successor
I have been looking for the reason why I get this error message for

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.