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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:52:58+00:00 2026-05-13T17:52:58+00:00

So after about an hour wasn’t able to find a good tutorial on how

  • 0

So after about an hour wasn’t able to find a good tutorial on how to use these tags and their ids,names, and values to achieve a decimal amount to finish summing my form. Simply put I have a select box and wish for it to return my option value and the amount of that option value.

Heres the HTML

<tr>
        <th colspan="4" class="label">Shipping Method:
          <select name="shipMethod" id="shipMethod" size="1">
            <option value="">Choose a shipping method</option>
            <option value="priority2">Priority mail $3.20 (4 items or less)</option>
            <option value="priority3">Priority mail $4.30 (6 items or less)</option>
            <option value="priority4">Priority mail $5.40 (8 items or less)</option>
            <option value="overnight">Express $15.75 (4 items or less only)</option>
            <option value="UPS">UPS - 2 day $15.00 (9 - 49 items)</option>
            <option value="free">Free shipping (50+ items only)</option>
          </select>
        </th>
        <td><input name="shippingChg" id="shippingChg" type="text" size="10" maxlength="60" value="" /></td>
      </tr>
      <tr>

Probably my first problem is setting up a loop for the decimal side of things. This is how I would attempt to write my loop and function for one select box

 function ship_some_stuff()
 var ship_me= document.getElementById("shipMethod").value; (unsure if this returns
 the option value though, but the idea is to save to a variable later)

 if ship_me == priority2 {
 var shipthisway = 3.20;
 document.getElementById("shippingCHg").value = varshipthisway ;
 }

 if ship_me == priority3{
 var shipthisway = 4.30;
 document.getElementById("shippingCHg").value = varshipthisway ;
 }


 else varship == ""; {
 alert("You haven't selected a shipping Method");
 }

Thanks for the help!

  • 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-13T17:52:58+00:00Added an answer on May 13, 2026 at 5:52 pm
    function get_shipping_charge() { 
      var ship_me= document.getElementById("shipMethod").value;
      if (ship_me == "priority2") return 3.20;
      else if (ship_me == "priority3") return 4.30;
      else return NaN;
    }
    function do_shipping_charge() {
      var shipthisway = get_shipping_charge();
      if (shipthisway) document.getElementById("shippingCHg").value = shipthisway;
      else alert("You haven't selected a shipping Method");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 296k
  • Answers 296k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You should put up a maintenance page if the application… May 13, 2026 at 7:03 pm
  • Editorial Team
    Editorial Team added an answer Here's a link to a page that explains exactly what… May 13, 2026 at 7:03 pm
  • Editorial Team
    Editorial Team added an answer You can't detect the difference between stack and heap allocation… May 13, 2026 at 7:03 pm

Related Questions

I make extensive use of source control for anything that relates to a project
I have a table that was doing a fine job of full-text search until
I need help figuring out why my authentication ticket is expiring after about an
I'm encountering a situation where it takes a long time for ASP.NET to generate
I'm looking for a square pixel font, preferably 8x8 pixels per character. I would

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.