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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:14:10+00:00 2026-06-01T03:14:10+00:00

Is there a way to apply fade effect after validation. For example the user

  • 0

Is there a way to apply fade effect after validation. For example the user leave a textfield blank, then I’ll return a text saying “All Fields Are Required!”.

Currently I have this:

.successbox, .warningbox, .errormsgbox {
    font-weight:bold;
    border: 2px solid;
    margin: 10px 0px;
    padding:15px 10px 15px 70px;
    background-repeat: no-repeat;
    background-position: 10px center;
    width:600px;
}
.errormsgbox {
    color: #D8000C;
    background-color:#FDD5CE;
    background-image: url('../images/error.png');
}

I’m returning the error like this:

        <?php if($error) : ?>
           <div class="errormsgbox" ><?php echo $error ?></div>
    <?php endif ?>

And my js up to now is just like:

$(".errormsgbox").fadeOut("slow");
  • 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-01T03:14:11+00:00Added an answer on June 1, 2026 at 3:14 am

    I always check for blank fields, poorly formatted emails, etc. with JS and jQuery. I tend to do a lot of ajax, so I also do a lot of callback handling along these lines. Here’s an example of handling errors for an ajax form:

    function FieldValidation()
    {
      //selectors may vary!      
      this.whateverFields = {
        user: $( '#user_field' ),
        email: $( '#email_field' )
      }
    
      this.whateverForm = function()
      {
        var wF = this;
        $( '#form' ).submit( function( e ){
          e.preventDefault();
    
          wF.resetWhateverForm();
    
          //cache just in case you want to check against multiple error types
          var user_val = wF.whateverFields.user.val();
          var email_val = wF.whateverFields.email.val();
    
          var error_array = [];
          var n = 0;
    
          if( user_val === '' ){ error_array[ n ] = 'user_error'; n++; }
          if( email_val === '' ){ error_array[ n ] = 'email_error'; n++; }
    
          if( n > 0 )
          {
            var len = error_array.length;
            for( var i = 0; i < len; i++ )
            {
              switch( error_array[ i ] )
              {
                case 'user_error':
                  wF.whateverFields.user.addClass( 'error' ).next().fadeIn( 'fast' );
                  break;
    
                case 'email_error':
                  wF.whateverFields.email.addClass( 'error' ).next().fadeIn( 'fast' );
                  break;
    
                default:
                  return false;
              }
            }
    
            return false;
          }
    
          //do ajax now...
        });
      }
    
      this.resetWhateverForm()
      {
        for( var key in this.whateverFields )
        {
          if( this.whateverFields.hasOwnProperty( key ) )
          {
            this.whateverFields[key].removeClass( 'error' ).next().hide();
          }
        }
      }
    
      //pop any load-ready methods in here
      this.intialize = function()
      {
        this.whateverForm();
      }
      this.intialize();
    }
    
    $( document ).ready(function(){
      var fv = new FieldValidation();
    });
    

    Here’s an example of some markup:

    <form id='form'>
      <input id='user_field' name='user_field' type='text' />
      <span class='rqd_txt'>You must fill out this field.</span>
    
      <input id='email_field' name='email_field' type='text' />
      <span class='rqd_txt'>You must fill out this field.</span>
    
      <button type='submit' id='whatever'></button>
    </form>
    

    Some css:

    .error{ border: 1px solid red; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to apply brightness to uiimages. For example I have a
Is there a way to apply a blur effect on a background image in
Is there any way to apply shader effect on particular cell of a Grid.
We can apply only one effect to an element. Is there any way to
Is there a way to apply an underline text decoration to one character only
It there any way to apply special formatting for the menu item immediately after
Is there a way to apply some functions like:brightness,contrast,sharpness,hue,saturation,exposure to uiimages. For example I
Is there a way to apply a blur effect to the whole background behind
Is there a way to apply, say, a DropShadowFilter to the text within a
Is there any way to apply an attribute to a model file in ASP.NET

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.