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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:24:57+00:00 2026-05-23T18:24:57+00:00

I have this piece of code I’ve been working on but there’s a problem,

  • 0

I have this piece of code I’ve been working on but there’s a problem, here’s the code:

$('form input').keyup(function () {
    if($(this).hasClass('field-error')){

        $('.btn').addClass('no-submit').removeClass('btn');
        $('.error-notify').show();          
    }
    else{

        $('.no-submit').addClass('btn').removeClass('no-submit');
        $('.error-notify').hide();

        $('.btn').click(function(){ 
            $(this).parent().find('form').submit();
        });
    }
}); 

What I’d like to happen is..when all form inputs(x5) have been checked and there are no instances of any form inputs having the ‘.field-error’ class the then .btn class becomes clickable and the form can be submitted

If you’d like me to further make clear what I mean, just let me know.

Any help is greatly appreciated, 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-23T18:24:57+00:00Added an answer on May 23, 2026 at 6:24 pm

    Change this line:

    if($(this).hasClass('field-error'))
    

    To this:

    if($(this).siblings().andSelf().hasClass('field-error'))
    

    I think this is what you want (see this Updated Fiddle), though am not totally sure. From what I can see it doesn’t disable when the field = ‘?’.

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

Sidebar

Related Questions

I have this piece of code: $(input).keyup(function() { var searchTerms = getSearch(); doSearch(searchTerms); });
I have this piece of code: <input type=text name=desc id=desc onchange=OnDescChange(); /> but it
I have this piece of code that is working but is kind of cumbersome.
I have this piece of code, but can't seem to get it working. success:
I have this piece of code (summarized)... AnsiString working(AnsiString format,...) { va_list argptr; AnsiString
I have this piece of code: $(#faq).click(function () { var url = $.get(faq, {
I have this piece of code: var myObj = function () { this.complex =
I have this piece of code I'm trying to get to display but no
I have this piece of code: $(document).on(click, #breadNavMain, function() { for(var i = 0;
I have this piece of code here below: $fq.= + (fritidsboende_uth_from:[$fritids_uth_from TO *] AND

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.