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

  • Home
  • SEARCH
  • 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 9148831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:22:50+00:00 2026-06-17T11:22:50+00:00

I was just trying to use a function of jQuery in my JavaScript code

  • 0

I was just trying to use a function of jQuery in my JavaScript code for styling. I want that whenever the required text field is empty, the textfield should shake, but I can’t do it. Please help me out I just wasted my whole night on it. Finally asking for your help. I hope that you people get my question.

The code is given below

function validate() {
  var em = document.getElementById("email_value").value;
  var pass = document.getElementById("password_value").value;

  if(em == "") {
    shakeIt();
  }                   
}

$(document).ready(function() {
  function shakeIt() {
    $("input").effect("shake", { times:5}, 50);
  }
});
  • 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-17T11:22:52+00:00Added an answer on June 17, 2026 at 11:22 am
    function validate()
    {
        var em = document.getElementById("email_value").value;
        var pass = document.getElementById("password_value").value;
    
        if(em == "")
        {
            shakeIt();
        }
    }
    
    function shakeIt()
    {
        $("input").effect("shake",
        {
            times: 5
        }, 50);
    }
    

    Don’t wrap it in $(document).ready() function, because your shakeIt function is not longer in global scope, if you do so.

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

Sidebar

Related Questions

I'm trying to use JavaScript prototypes together with jQuery's .data() function. My code looks
I'm trying to use the following code (poorly written, but it's just a proof
I am trying to use the jQuery CSV plugin, as documented here: http://code.google.com/p/js-tables/wiki/CSV According
I'm trying to use prototype inheritance in Javascript. The problem with my code below
Below is the code I keep trying; I'm basically just trying to use this
I was just trying to learn and understand jQuery source code (so far with
Now, bear in mind I'm just trying to ensure that the code works by
I'm trying to use the FitText jquery plugin to get resize some text. The
I am trying to get all checkboxes checked with: <script type=text/javascript> $(document).ready(function() { $(#delmsg_all).click(function()
I'm trying to use jquery to set some default text in a form input.

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.