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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:30:05+00:00 2026-06-04T18:30:05+00:00

I have many functions written in JavaScript such as userName() , password() etc. But

  • 0

I have many functions written in JavaScript such as userName(), password() etc. But on submitting on the form, I have a single function return formValidator();.

I want function to call all the other functions and check whether they are returning false or not. If they all are true than it should return true, otherwise it should return false.

function userName(){
      var x=document.forms["signupform"]["firstname"].value;
            if(x=="" ||x==null){
           document.getElementById("firstname").style.border="1px solid #F50A0A";
           document.getElementById("firstname").style.boxShadow="2px 2px 5px #F50A0A";
           return false;
      }else {return true;}
}

function password(){
 var z=document.forms["signupform"]["password"].value;
      if(z=="" ||z==null){
            document.getElementById("password").style.border="1px solid #F50A0A";
           document.getElementById("password").style.boxShadow="2px 2px 5px #F50A0A";
            return false;
      }else {return true;}
}
  • 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-04T18:30:06+00:00Added an answer on June 4, 2026 at 6:30 pm

    You can call each function, using the && operator to indicate that each one must return something that evaluates to true. If any one of them returns something that evaluates to false, the entire statement will evaluate to false:

    function formValidator() {
        return userName() && password() && somethingElse() && etc();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have written such a class (number of functions doesn't really matter, but
I have used many of the Convert.To..... functions for conversion , but I didn't
Many people have argued about function size. They say that functions in general should
i have many events such as $('.hidefile').click(function (event) { On page load and on
Bit of a badly written question, but basically I have a Form for users
I have many structs (classes) and standalone functions that I like to compile separately
I have seen the fastcall notation appended before many functions. Why it is used?
i have many actions that should have the same function <ul> <li> <select id=s1>
I have many js methods that uses global variables like: function DoSomething() { var
I have seen many js frameworks (including jquery) using closure around their main function

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.