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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:50:45+00:00 2026-05-26T19:50:45+00:00

For some reason Im unable to get the submit button below to re-enable once

  • 0

For some reason Im unable to get the submit button below to “re-enable” once it has been disabled. Basically when the user puts in a non-numeric I want to disable the button and then reenable the button once a numeric value has been entered. Im still working on the entire validation process (and I do realize there is a plugin) but am still learning JQuery and for now I’d like some assistance in figuring out why the button is not re-enabling at the moment. Here is the code.

<style type="text/css">
.focusField{
   border:solid 2px red;
   background:pink;
   color:#000;
}
</style>

<script>

 function isNumber(n) {   
  return !isNaN(parseFloat(n)) && isFinite(n); 
 }

 function validateAmount(curObj) {
  var original_val = curObj.value;
  var current_amt = parseFloat(curObj.value); 
  $(curObj).val(current_amt.toFixed(2));
  if(!isNumber($(curObj).val()))
  {
   $(curObj).addClass("focusField");
   $(curObj).val(original_val);
   $('.toggleButton').attr('disabled','disabled');
  }
  else
  {
     $(curObj).removeClass("focusField");
     $('.toggleButton').removeAttr('disabled');   
  }
 }

 $(function() {  
  $(".formatted-number-input").blur(function() {
   validateAmount(this);
  })
 }); 
 </script>

<form name="invoice_form" id="invoice_form" action="index.cfm" method="post">
<input name="charge_amount_1" id="charge_amount_1"  type="text" class="formatted-number-input"  />
<input name="go" id="go"  type="submit" value="Submit Adjustment" class="toggleButton"  />
</form>
  • 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-26T19:50:46+00:00Added an answer on May 26, 2026 at 7:50 pm

    Replace removeAttr('disabled') with .prop('disabled', false).
    If you’re using jQuery version 1.6 or lower, use .attr('disabled', false), instead.

    Links:

    • .attr
    • .prop (since version 1.6)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason I am unable to get the pattern match for preference_network_ followed
I am unable to get my sessions captcha to work for some reason. This
For some reason, no matter how I go about it, I cannot get TortoiseSVN
I need something real simple, that for some reason I am unable to accomplish
Hi guys for some weird reason I'm unable to send email using zend mail
I have the following code pasted below. For some reason, the response.redirect seems to
For some reason I am unable to read any cookies from my CakePHP app
I'm trying to get lein up and running. But for some reason I'm having
For some reason I am unable to use query results in the same function
For some reason, my ability to attach a debugger to ANYTHING has just stopped.

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.