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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:28:31+00:00 2026-06-17T12:28:31+00:00

i want to protect my inputs from brut force hacks so i made some

  • 0

i want to protect my inputs from brut force hacks
so i made some validations for my inputs .. and i want them to work on focus event and
focusout event too ! is there any elegant way to do it, other than this :

$(this).focus(function(){
// excute my code
});

and then

$(this).focusout(function(){
// excute the same code !
});

i want do this for too many inputs .. and i don’t want do the same work twice for (focus, and focusout) to avoid the extra load of the page !

  • 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-17T12:28:32+00:00Added an answer on June 17, 2026 at 12:28 pm

    While I disagree with the premise of this question (you can’t prevent brute-force attacks via client-side code) you can simplify your code by passing both events as a space separated string to on:

    $(this).on('focus focusout', function() {
        // excute my code
    });
    

    Here’s the fiddle: http://jsfiddle.net/bL79F/


    If you’re using an older version of jQuery, use bind instead:

    $(this).bind('focus focusout', function() {
        // excute my code
    });
    

    Here’s the fiddle: http://jsfiddle.net/bL79F/1/

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

Sidebar

Related Questions

I want to protect a directory and the php files in it, from direct
I have a server application which I want to protect from being stopped by
I want to protect all forms from CSRF with Dancer . I tried using
I want to protect a website from being accessed until a user has agreed
I want to protect my website against spambots with javascript. I found this code,
I have developed a small application and now i want to protect it. I
i search online but can't get satisfactory result i want to protect images on
Good day! I want to protect my database when I save a row in
how to add some delay between startup projects in solution? I want Client project
I have this jQuery code from my previous project and I want to modify

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.