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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:39:36+00:00 2026-06-12T17:39:36+00:00

I’ve seen several forms on webshops where you just change the amount of items

  • 0

I’ve seen several forms on webshops where you just change the amount of items you want, and it instantly changes the price. No reloading and no submit (or calculate) button.

I’m looking for something like that, but very simple.

Amount of pages: [textfield]
price: [answer]

That’s all.
The code must take the input from the [textfield] and multiply it with a certain number (which I can change in the code). The result of that calculation should be presented at [answer].

I’ve been looking around on Google, but I can only find very difficult and big forms that use a submit button. And my php/ajax/javascript isn’t good enough to write te code myself.
I know that there are several Submit forms on Stackoverflow, but I don’t understand how I can edit them to do what I want it to do.

You don’t have to make it look fancy, I’ve made a nice form to put the code in.
Obviously it has to work on every major browser.

Edit:
I’ve tried the code supplied by Khòi.

I’ve tried playing with this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script src="jquery-1.8.2.min.js" type="text/javascript" defer="defer">
$('#pages').change(function(ev){
var total = $('#pages').val() * 0.2;
$('#total').html((total).toFixed(2));
});?
</script>
</head>
<body>

Pages: <input type="text" name="pages" id="pages" />
<br/><br/>
Total: <span id="total">0.00</span>

</body>
</html>

But that doesn’t work ??
I did download the Jquery file and put into the same folder as this page is.

  • 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-12T17:39:38+00:00Added an answer on June 12, 2026 at 5:39 pm

    I’d advise you to learn some basic JQuery. Things like these can be done very efficently with JQuery and the learning curve isn’t too steep.

    I made you a fiddle to get you started:

    http://jsfiddle.net/jRs3n/

    Here is the full code for a single working HTML page:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    
    <title>test</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
    
    <script  type="text/javascript">
    $(document).ready(function() {
        $('#pages').keyup(function(ev){
            var total = $('#pages').val() * 0.2;
            $('#total').html((total).toFixed(2));
        });
    });
    </script>
    </head>
    <body>
    
    Pages: <input type="text" name="pages" id="pages" />
    <br/><br/>
    Total: <span id="total">0.00</span>
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm interested in microtypography issues on the web. I want a tool to fix:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to show the soap response to UIWebview.. my soap response is, <p><img
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I want to construct a data frame in an Rcpp function, but when I

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.