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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:56:26+00:00 2026-05-24T23:56:26+00:00

I need a little help adjusting this code, any advice is appreciated: The desired

  • 0

I need a little help adjusting this code, any advice is appreciated:

The desired result is to have two values returned instead of just one, so for example:

Input Value = " " (Text box )
this.value = 226 - this.value * .5;  ( value #1 Text Box2) 
this.value = 226 - this.value * .9;  ( value #2 Text Box3)

HTML

<form id='myform'>
    <input value=" "/><br>
    <a href="#" class='THR'>click to calculate THR</a><br><br>
</form>

CODE

$('a.THR').click(function() {
    $('#myform :text').each(function() {
    this.value = 226 - this.value * .5;
    });
});
  • 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-24T23:56:26+00:00Added an answer on May 24, 2026 at 11:56 pm

    Ok, I’m not really sure what you want to accomplish but if you just want to make two calculations and display the results you can do this:

    HTML:

    <input id="number" value="" /><br>
    <a href="#" class='THR'>click to calculate THR</a>
    <div id="answer1"></div>
    <div id="answer2"></div>
    

    JS:

    $('a.THR').click(function() {
        var value = parseInt( $( "#number" ).val() );
        $( "#answer1" ).html( 226 - value * 0.5 );
        $( "#answer2" ).html( 226 - value * 0.9 );
        return false;
    });
    

    Since you have only one input field there’s no reason to use an each loop, just give it an id and refer to it directly. The containers for the results can be anything you want as long as you can refer to them with jQuery (ids are a good choice).

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

Sidebar

Related Questions

I need a little help with the fsockopen function. I have this PHP code:
I need a little help on this subject. I have a Web application written
I need little help with inheritance in C++. I have code with same structure
need a little help with this one. I have a form that I am
Need a little help with string formatting... I have a string like this: Bmw
Hey, need a little help here. I have two models: class User < ActiveRecord::Base
I'm so close on this one, but I need a little help. I have
I have started to study UML standard and would need little help with two
I need a little help here. This code correctly displays every format I enter--except
I need a little help positioning a div correctly. This is my code: <td

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.