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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:45:59+00:00 2026-06-18T01:45:59+00:00

How to remove disable attribute from button when user types all info in input

  • 0

How to remove disable attribute from button when user types all info in input and checked checkbox?

My try:

FULL CODE: http://jsfiddle.net/7zMRM/1/

$('#id_accept').click(function(){
    if($('#id_accept:checked').length == 1 && $('#id_blz').length == 8 && $('#id_account_owner').length > 3 && $('#id_account_number').length == 22 && $('#id_bank_name').length > 3){

        $('#open').removeAttr('disabled');
        $('#open').attr('onclick','javascript:yourFunctionName();');
    }
    else{
        $('#open').removeAttr('onclick');
        $('#open').attr('disabled','disabled');

}
});
  • 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-18T01:46:01+00:00Added an answer on June 18, 2026 at 1:46 am

    First of all, you should not do this on:

    $('#id_accept').click(function(){
    

    So, you need to do on the input‘s change event.

    $("form input").change(function(){
    

    Moreover, you haven’t wrapped the assignment inside $(document).ready() and also, you have two forms.

    And also, you have to check for the checkbox value this way:

    $('#id_accept').prop("checked");
    

    Another mistake is you should not use .length that way, it should rather be:

    $('#id_blz').val().length
    

    Final Code:

    $(document).ready(function(){
    $('form input').blur(function(){
        if($('#id_accept').prop("checked") && $('#id_blz').val().length == 8 && $('#id_account_owner').val().length > 3 && $('#id_account_number').val().length == 22 && $('#id_bank_name').val().length > 3){
            console.log("passed");
            alert($('#id_blz').length);
            $('#open').removeAttr('disabled');
            $('#open').attr('onclick','javascript:yourFunctionName();');
        }
        else{
            console.log("failed");
            $('#open').removeAttr('onclick');
            $('#open').attr('disabled','disabled');
    
    }
    });
    });
    

    Fiddle: http://jsfiddle.net/7zMRM/2/

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

Sidebar

Related Questions

How can I remove the disabled attribute from an HTML input using javascript? <input
How to remove disabled attribute from textbox in asp.net MVC during run time In
Possible Duplicate: ASP.NET: how to remove 'name' attribute from server controls? On asp.net form
I have a submit button which is disabled until a user chooses from a
I am trying to disable user text input in a text field, and am
I have two select lists, I would like jquery to either remove or disable
remove() method without any argument removes all documents inside the collection. $this->db->$collection->remove(); But how
I remove item from ArrayList in foreach loop and get follwing exception. Collection was
in wrong i remove the path from my computer, now the path is empty
I would like to disable client side validation on certain fields in my user

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.