Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
JS Conditional IF for form validation

Working with a sign up form that can have conditional inputs. It is possible that the Country value is not always necessary when signing up. Is there a "conditional IF statement" through which I could do the form check? In otherwords, check signupForm.country.length only if Country is true. For context, below is the code where I am trying to implement the logic:

    const submit_button_disabled =
        !(agreeTerms
        && signupForm.email.length > 0
        && (signupForm.email == signupForm.email2)
        // && (if countryRequired && signupForm.country.length > 0);
        // check signupForm.country.length IF countryRequired
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!