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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:47:57+00:00 2026-05-15T21:47:57+00:00

I have a new function that I will be calling when the submit button

  • 0

I have a new function that I will be calling when the submit button is pressed for the form. I’m trying to use this validation, not a plug-in, for experience.
How would I iterate through all the forms, determine if they’re all valid, before exiting out of the function. Though if they’re all valid, return true and continue, otherwise if false, stay in the isFormValid function until all the forms are valid. Any ideas?

Here’s what I’ve got so far.

function isFormValid() {

var valid = false;

$('form :input').each(function() {

 var input = $(this);
 label = $(input).prev();

 if (!$.trim(input.val()).length) {
   label.effect('pulsate', { times : 1 }, 400).addClass('required');
   $(":input[value='']:not(.nofocus):visible:enabled:first").focus();
   valid = false;
 }
 else if (input.attr('id') == 'email') {
  if (!isValidEmailAddress(input.val())) {
     label.effect('pulsate', { times : 1 }, 400).addClass('invalid')
     input.val('');
     $(":input[value='']:not(.nofocus):visible:enabled:first").focus();
     valid = false;
   }
  }
 });
}

Thanks

  • 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-15T21:47:58+00:00Added an answer on May 15, 2026 at 9:47 pm

    Got it. Only had to add this outside the each iteration and change the original var valid = true

    if (!valid) {
        return false;
    }
    else
        return true;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 507k
  • Answers 507k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It is not possible at all, at least for arbitrary… May 16, 2026 at 4:05 pm
  • Editorial Team
    Editorial Team added an answer Try: for a in [0-9]*.txt; do mv $a `printf %04d.%s… May 16, 2026 at 4:05 pm
  • Editorial Team
    Editorial Team added an answer I can see encountering this problem if the content menu… May 16, 2026 at 4:05 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a PHP form that needs some very simple validation on submit. I'd
//This is the function that will run every time a new item is added
I have an action that saves new procucts like this: @products = Product.new(params[:product]) @products.save
I have created a Windows Service that will be calling out to some COM
What I am trying to do is create a function that will be called
I have a code that changes the function that would be called, to my
I'm trying to put together a MYSQL query that will count the number of
I have a Qt main window that will pop up a dialog box that
I have a computer that is running a single program that manages up to
I read that adding functions to an object will chew up more memory then

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.