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

Related Questions

Well, I was able to simply enough (after about an hour of googling) implement
After spending half an hour to find a proper, self-explaining title for this question,
I'm here to write you after about 1.5 hour of hard debugging. First of
OK I keep getting this error after about 3-4 minutes of churning: Timeout expired.
I am using an open source .Net library which uses MSMQ underneath. After about
I started cloning an SVN repository using the git-svn's clone operation. After about 6
After messing about with F# there are some really nice features that I think
After reading about the problem of passing empty std::string objects between DLLs and EXEs,
After learning about the Action delegate in C# I've been looking for ways I
Can I specify interfaces when I declare a member? After thinking about this question

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.