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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:41:43+00:00 2026-06-03T13:41:43+00:00

I am currently creating an order form. However, I have been stuck at the

  • 0

I am currently creating an order form. However, I have been stuck at the value obtaining.
It is a product order form, I want to display price and calculate the amount by users’ choosing.

For example, I got a product quantity drop down list, so when the user chooses one product, the price div will display one value, if the user chooses 0, the price div will display $0. Where is the problem?

var productValue = document.getElementById("e_Product");
var productQuantity = document.getElementById("e_Quantity");
var stringValue = productValue.options[productValue.selectedIndex].text;

if (stringValue == "Product Name" && productQuantity == 1) 
{
    var singleValue = "$800.00";
    $('#e_Price').val(singleValue);
}
else
{
    var singleValue1 = "$0.00";
    $('#e_Price').val(singleValue1);
}

Also, in a form, how to disable the edit function to the input fields? I found when I obtain the value for those product, the user still can type whatever they want in the fields.

For displaying values in input fields, I feel that i can only use val() to output the value, so everytime I need to set a new variable to hold the value, but for the order form, I want to add a calculation function at the end. Like the user chooses the product, product quantity and the shipping options, I need to get the amount of all those fees.

Sorry about the expression, a little bit mess, several questions are put together, kinda have no idea what I am doing.

Thank you guys very much in advance.

  • 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-03T13:41:44+00:00Added an answer on June 3, 2026 at 1:41 pm

    Use global variable

    var singleValue = "$0.00";
    if (stringValue == "Product Name" && productQuantity == 1) 
    {
      singleValue = "$800.00";
    $('#e_Price').val(singleValue);
    }
    else
    {
     $('#e_Price').val(singleValue);
    }
    

    For disable textbox (total amount field)

    $('#id').attr('disabled',true);
    

    or

    $('#id').attr('disabled','disabled');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently creating an order form. However, I have been stuck at the
im currently creating a graph for an app, using coreplot and have a problem
We are currently creating an InfoPath 2007 form is deployed in SharePoint 2007. In
I'm currently creating a user interface using WPF and would like to display a
I have been creating a web app and am looking to expand. In my
I am creating a order cart for a table of products. Each product is
I have a form where I'm creating an interview for a job posting and
I'm currently creating a small todo site, and I have multiple questions related to
I'm using Simple Form. I have a form for creating new items, and a
I am currently creating a Perl module for in house use. I used ExtUtils::ModuleMaker

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.