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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:23:58+00:00 2026-06-14T03:23:58+00:00

Hey Guys, Today I am developing a JavaScript quote system, the JS is as

  • 0

Hey Guys,

Today I am developing a JavaScript quote system,

the JS is as follows

 <script type="text/javascript">
 <!-- Hide this code from non-JavaScript browsers
 function TotalIt() {
 CostPerStairs=25;
 CostPerHall=50;
 CostPerSingle=35;
 CostPerDouble=50;

 f1=document.forms[0]; // abbreviation

 RI=f1.SelR.selectedIndex;
 RV=RI*CostPerStairs;
 HI=f1.SelH.selectedIndex;
 HV=HI*CostPerHall;
 SI=f1.SelS.selectedIndex;
 SV=SI*CostPerSingle;
 CI=f1.SelC.selectedIndex;
 CV=CI*CostPerDouble;
 TV=RV*1+HV*1+SV*1+CV*1;

 RV=Math.round(RV*100)/100;
 HV=Math.round(RV*100)/100;
 SV=Math.round(SV*100)/100;
 CV=Math.round(CV*100)/100;
 TV=Math.round(TV*100)/100;

 f1.TotR.value=RV;
 f1.TotR.value=HV;
 f1.TotS.value=SV;
 f1.TotC.value=CV;
 f1.Total.value=TV;

 return true;
 }
 // End hiding -->
 </script>

The HTML aspect lies here

 

Room Type
Quantity to Clean

Stairs

– 0 –
1
2
3
4

Hall

– 0 –
1
2
3
4

Single Bedroom

– 0 –
1
2
3

Master Bedroom

– 0 –
1
2
3
4
5

 

Total

So – I hear you say – what is the Question?

Essentially, what I would like to add is a poscode drop down box, that initiates a minimum value for the total price TV=RV*1+HV*1+SV*1+CV*1;

The idea is that when a postcode is selected, the value of TV (total) must be a minimum price or above

The HTML I have put in for this is as follows;

<tr>
  <td>Select a Postcode</td>
  <td align="center"><select name="SelP">
    <option>- 0 -</option>
    <option>LS1</option>
    <option>LS2</option>
    <option>LS3</option>
    <option>LS4</option>
  </select>
    <input type="hidden" name="TotR" onFocus="this.blur();" />
    <br></td>
</tr>

However I don’t know how to put this into the Java, I have tried a few ways (basically trial and error), I think i could do it with PHP by using some if and where clauses however I’ve been stumped by the JavaScript here.

Any suggestions would be greatly appreciated.

  • 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-14T03:23:59+00:00Added an answer on June 14, 2026 at 3:23 am

    You want Math.max(x, y). It takes two values and returns the largest of the two, thus setting a minimum value.

    var myMinimumValue = f1.SelP.selectedIndex;
    
    // Sets TV to a minimum of selected index of SelP
    TV = Math.max(myMinimumValue, TV);
    

    If SelP contains options with specific values (which I guess is what you’re really after) like so:

      <select name="SelP">
        <option value="0">- 0 -</option>
        <option value="200">LS1</option>
        <option value="400">LS2</option>
        <option value="1000">LS3</option>
        <option value="2000">LS4</option>
      </select>
    

    Then you want something like:

    var myMinimumValue = f1.SelP[f1.SelP.selectedIndex].value;
    
    // Sets TV to a minimum of the selected value of SelP
    TV = Math.max(myMinimumValue, TV);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys this is my html code: <div class=nakupy> <li class=icn_kategorie><a href=#>Nákupy</a> <div class=sub_menu>
Hey guys, in this piece of code. Is there a way to redirect the
hey guys I have the follow code in js: $(document).ready(function(){ $(.replyLink).click(function(){ $(#form-to-+this.id).html(htmlForm()).toggle(500); return false;
Hey guys I'm working with this forum, I want to hide the categories list,
Hey guys I'm having such a hard time of it today. I have a
hey guys having this really simple problem but cant seem to figure out have
Hey guys, I always get confused by this so it's not exactly my strong
Hey guys I managed to get a text input and select box to updated
Hey Guys I've been struggling with this for the last hour and pouring over
hey guys should be a easy one...I have some javascript that is turning my

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.