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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:26:51+00:00 2026-06-15T22:26:51+00:00

I am not very good with javascript and I dont even know if this

  • 0

I am not very good with javascript and I dont even know if this is possible.

Im trying to get a dropdown to be selected depending on the value of a text field

I have the following text field which is calculated by adding the Number of Adults and Children together.

<input type="text" name="Total" id="Total" onfocus="this.blur()"/>

What I would like to do is depending on the value of the Total have the following dropdown change .ie if Total is less than 10 have the dropdown show 1 Hr, between 10 and 20 show 2 Hrs etc

<select name="Duration">
<option value="1">1 Hr</option>
<option value="2">2 Hrs</option>
<option value="3">3 Hrs</option>
<option value="4">4 Hrs</option>
</select>
  • 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-15T22:26:53+00:00Added an answer on June 15, 2026 at 10:26 pm

    I think this is the general direction that you would need to go (I am only including the case where the total is less than 10, so you would need to add the other situations to the if statement):

    <input type="text" name="Total" id="Total" onfocus="this.blur()" onblur="if(this.value < 10) { document.getElementById('totalDropDown').value = 1; }"/>
    
    <select name="Duration" id="totalDropDown">
        <option value="1">1 Hr</option>
        <option value="2">2 Hrs</option>
        <option value="3">3 Hrs</option>
        <option value="4">4 Hrs</option>
    </select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone please help me with this...I'm not very good with regular expressions and
I have the following list: <ul> <li onclick=populateComment(..this.)>very good </li> <li onclick=populateComment(..this.)>not so good</li>
I'm not very good in SQL and HQL... I have two domains: class Hotel
I'm not very good at PHP and would like to have a PHP function
I'm not very good at regex but maybe there's a simple way to achieve
I'm not very good with Django's form . Here is Order from models.py class
I'm not familiar at all with JQuery and I'm not very good with CSS,
First off, I am not very good with MySQL yet, so go easy on
I've been working with asp.net MVC and am still not very good at it.
Hi I have some experience with programming but I'm not very good with pointers.

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.