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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:48:06+00:00 2026-06-16T16:48:06+00:00

I am very new to JavaScript and JQuery so there may be a very

  • 0

I am very new to JavaScript and JQuery so there may be a very simple solution to my problem. What I want to do is print out the unit number that is selected to the screen. The unit numbers change depending on what machine type is selected, the unit number drop down specific to the machine type is un-hidden when the machine type is selected. How can I tell JavaScript or JQuery to print the value selected in the unit number drop down?

<!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Test</title>
        <script src="../jquery-1.8.3.js"></script>
        <script src="jsFunctions.js" type="text/javascript"></script>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <link media="Screen" href="timeCard.css" type="text/css" rel="stylesheet" />
        <link media="only screen and (max-device-width: 480px) and (min-device-width: 320px)" href="mobile.css" type="text/css" rel="stylesheet" />
    </head>
    <body>

            <h1>What do you want to do?</h1>
            <div id="buttons">
       <button type="submit" id="punchIn" onclick="timeIn()">Clock In</button>
       <button type="submit" id="updateJob" onclick="updateJob()">Update</button>
       <button type="submit" id="punchOut" onclick="timeOut()">Clock Out</button>
       </div>

       <div id="content">

       <label id="jobDesc" style="display: none">Job Description</label>
           <input type="text" id="jobDescription" style="display: none"/>

       <label id="equipRan" style="display: none">Equipment ran</label>
            <select size="1" name="equipmentList" title="" id="equipmentList" style="display: none">
                <option value="">Select Machine</option>
                <option value="EX">Excavator</option>
                <option value="DZ">Dozer</option>
                <option value="SC">Scraper</option>
            </select>

       <div class="unitDropDowns">
          <div class="EX">
            <select class="exUnitNumbers">
                <option value="">Unit number</option>
                <option value="01E">01E</option>
                <option value="2E">2E</option>
                <option value="4E">4E</option>
            </select>           
        </div>

            <div class="DZ">
                <select class="dzUnitNumbers">
                    <option value="">Unit number</option>
                    <option value="01D">01D</option>
                    <option value="2D">2D</option>
                    <option value="1D">1D</option>
                </select>
            </div>

            <div class="SC">
                <select class="scUnitNumbers">
                    <option value="">Unit number</option>
                    <option value="54C">54C</option>
                    <option value="53C">53C</option>
                    <option value="52C">52C</option>
                </select>
            </div>

       </div>

       <button type="submit" id="updateButton" onclick="dbQuery()" style="display: none">Submit</button>

       <div id="summary">
            <div id="timeDiv" style="color: red;"></div>
            <div id="descriptionSummary" style="display: none"></div>      
            <div id="equipmentRan" style="display: none"></div>
       </div>

      </div>
    </body>
</html>

Javascript file

    $(document).ready(function() {
    $('#equipmentList').bind('change', function() {
    var elements = $('div.unitDropDowns').children().hide(); // hide all the elements
    var value = $(this).val();

        if (value.length) { // if somethings' selected
            elements.filter('.' + value).show(); // show the ones we want
        }
        }).trigger('change');
});

var timeIn = function() {

    var clockIn = new Date();
    timeDiv.innerHTML = clockIn;
}

var timeOut = function(){

    var clockOut = new Date();
    timeDiv.innerHTML= clockOut;
    document.getElementById("equipmentList").style.display = "block";
    document.getElementById("jobDescription").style.display = "block";
    document.getElementById("jobDesc").style.display = "block";
    document.getElementById("equipRan").style.display = "block";
}
var updateJob = function(){
    document.getElementById("jobDescription").style.display = "block";
    document.getElementById("updateButton").style.display = "block";
    document.getElementById("equipmentList").style.display = "block";
    document.getElementById("jobDesc").style.display = "block";
    document.getElementById("equipRan").style.display = "block";
}

var dbQuery = function(){
    var description = document.getElementById("jobDescription").value;
    var selectedEquip = document.getElementById("equipmentList");
    var selectedEquip1 = selectedEquip.options[selectedEquip.selectedIndex].text;
    document.getElementById("descriptionSummary").innerHTML = "<h3>Description</h3>" + "<p>" + description + "</p>";
    document.getElementById("equipmentRan").innerHTML = "<h3>Equipment Ran </h3>" + "<p>" + selectedEquip1 + "</p>";
    document.getElementById("equipmentRan").style.display = "block";
    document.getElementById("descriptionSummary").style.display = "block";
}
  • 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-16T16:48:08+00:00Added an answer on June 16, 2026 at 4:48 pm

    With

    var selectedVisibleValue = $(".unitDropDowns select:visible").val()
    

    you can get the selected visible value.

    I hope it helps…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would first want to say that I am very new to javascript and
May there is very simple solution but I am facing issue to solve this
I'm very new to jQuery and javascript in general, so maybe there's something I've
I'm very new to Javascript (and jQuery). My JSFiddle really shows the issue in
I am very new at jQuery ... I've used Javascript many times and am
I'm not a huge fan of the JavaScript frameworks that are out there today.
(very new to JavaScript jQuery) Can an if statement contain a collection of other
I'm very new to JQuery and don't have much experience with javascript at all,
(I am still very new to Javascript and JQuery) I am trying to keep
Very new to javascript and html-type stuff. I wanted to just make a quick

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.