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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:00:26+00:00 2026-06-14T08:00:26+00:00

i´m pretty new to php so im stuck with a easier calculator script…well… not

  • 0

i´m pretty new to php so im stuck with a easier calculator script…well… not easy to me but at least it doesnt sound too complicated.

firstly, i need to create a calculator that has 2 inputs… a dropdown list with cars (4 of them) that each of has a value (price per kilometer) and a textbox that user fills with a kilometer value (how many km´s he wants to drive). Then the output should be with jquery (live result). Operation is, of course, multiplying.

i would really appreciate if someone could help me out in this. im good at html and css but totally out of php.

<div class="styled-select"> 
  <select name="dropdown"> 
    <option value="<?=$car1;?>">Mercedes</option> 
    <option value="<?=$car2;?>">Scania</option> 
    <option value="<?=$car3;?>">Renault</option> 
    <option value="<?=$car4;?>">MAN</option> 
  </select> </div> 
  • 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-14T08:00:27+00:00Added an answer on June 14, 2026 at 8:00 am

    I think this is what you are after

    HTML

    <input id="distance"/>
    <select name="dropdown" id="cars">/* options*/
    <input id="result"/>   
    

    jQuery:

    $(function(){
        $('#cars, #distance').on('keyup change',function(){
            var dist=$('#distance').val();  
            var car=$('#cars').val();
            var res=  dist * car ;
            $('#result').val( res || 0 );
        });
    });
    

    DEMO: http://jsfiddle.net/d8ETu/

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

Sidebar

Related Questions

I'm new to php world (actually not so much, but pretty much). I make
I'm pretty new to PHP, but I decided to try and make a simple
I've done a fair bit of mysql php programming but am pretty new to
I'm sure this is pretty elementary but I'm new to php. Can someone tell
I'm pretty proficient in PHP, but want to try something new. I'm also know
I'm pretty new to php but i'm learning pretty fast, I have a question
I'm pretty new to php.. and this is probably a stupid mistake... but I
I am pretty new with PHP furthermore PDO so I am not fully aware
I'm pretty new to PHP, I'm working in WordPress but I don't think that
I am pretty new to PHP but I want to crate a website uptime

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.