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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:33:04+00:00 2026-05-26T00:33:04+00:00

I have a checkbox which updates totals on a page based on whether it’s

  • 0

I have a checkbox which updates totals on a page based on whether it’s checked or unchecked. On one part of my form, I would like to zero out a Telerik Numeric TextBox (Text Input field) if the user decides they do not require that category.

When unchecked, the textbox on the right should be set to zero.

When the above checkbox is unchecked, the value in the textbox on the right should change back to zero. To accomplish this, I’ve written the jQuery code below (note, this function is called whenever something changes on the form):

var zeroValue = getNum(0.00);

//Scaffolding
    if ($("#ScaffoldingRequired").attr('checked')) {
        scaffoldingCost = getNum($("#ScaffoldingCost").val());
        totalCost += scaffoldingCost;
    } else {
        $("#ScaffoldingCost").val(zeroValue);
        $("#ScaffoldingCost").text(zeroValue);
    }
//Round&Convert to 'decimal'
function getNum(num) {
        var number = parseFloat(num) || 0.00;
        var rNumber = Math.round(number * 100) / 100;
        return rNumber.toFixed(2) * 1;
    }

NOTE: To make sure everything rounds properly and doesn’t give me NaN’s, I’ve used my getNum function ( I understand it’s a bit hack ).

This code works, and all my totals calculate properly but the textbox does not display a zero value until the user actually clicks on the input box. I’ve displayed this below:

Displays Zero once the input box is clicked.

Is there something I can do to recycle my input box so it displays the zero value immediately? Or am I setting the value/text completely wrong?

  • 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-26T00:33:04+00:00Added an answer on May 26, 2026 at 12:33 am

    You say you’re using Telerik, have you considered using their client API for changing the value of the textbox?

    var textBox = $('#ScaffoldingCost').data('tTextBox');
    textBox.value(0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a checkbox which in some cases may be disabled and checked using
I need to have a checkbox which ajax-submits a form. The following code throws
I have a checkbox who's checked value is bound to a binding source which
I have a very simple PHP form, which shows a checkbox, and will store
I have a databinded checkedlistbox in one form and I would like to know
I have a checkbox in GridViewColumn which i use for show/change database value. The
I want to have a checkbox for terms and conditions, label of which should
I have a DataTemplate which contains a CheckBox and ListBox. When the CheckBox is
I have a Word.Field object which is a checkbox and the Type property equals
I have a dataGrid(not dataGridView) in which i need to add Checkbox dynamically at

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.