Selections made from the dropdown menu will automatically generate additional fields in the

The code I'm working with is too lengthy to post in its entirety, so here is the JSFiddle link instead:

https://jsfiddle.net/c0ffee/pew9f0oc/1/

My specific issue pertains to this screenshot:

https://i.sstatic.net/swLqN.png

Upon clicking on the dropdown menu, the options are visible but inaccessible as they seem to be obscured by the text input field beneath it.

                        <form>
                            <div class="input-field m-b-30">
                                <input type="text" id="firstName" placeholder="First Name" name="name" required="">
                                <label for="fullName">Required</label>
                            </div>
                            <div class="input-field m-b-30">
                                <input type="text" id="phoneNumber" placeholder="Phone Number" name="phone" required="">
                                <label for="phoneNumber">Required</label>
                            </div>
                            <div class="input-field m-b-30">
                                <input type="text" id="phoneNumber" placeholder="Phone Number" name="phone" required="">
                                <label for="phoneNumber">Business Name</label>
                            </div>
                            <div class="input-field m-b-30">
                                <input type="text" id="phoneNumber" placeholder="Phone Number" name="phone" required="">
                                <label for="phoneNumber">Phone Number</label>
                            </div>
                            <div class="input-field m-b-30">
                                <input type="email" id="emailAddress" placeholder="Email Address" name="email" required="">
                                <label for="emailAddress">Email</label>
                            </div>
                            <div class="input-field m-b-30">
                                <input type="text" id="subject" placeholder="I Would Like To Discuses " name="subject" required="">
                                <label for="subject">Subject</label>
                            </div>
                            <div class="input-field m-b-30">
                                <label for="cars">Choose a car:</label>

                                <select name="cars" id="cars">
                                  <option value="volvo">Volvo</option>
                                  <option value="saab">Saab</option>
                                  <option value="mercedes">Mercedes</option>
                                  <option value="audi">Audi</option>
                                </select>
                            </div>
                            <div class="input-field textarea-field m-b-30">
                                <textarea id="message" placeholder="Message" name="message"></textarea>
                            </div>

                            </div>
                            <div class="input-field">
                                <button type="submit" class="template-btn">Send Message <i class="fas fa-arrow-right"></i></button>
                            </div>
                        </form>

Any suggestions on resolving this issue?

Answer №1

Don't dive too deep into the complexities of CSS and javascript - you can easily solve the issue of a styled dropdown being hidden behind a textarea by adjusting the z-index. Simply update the container with this css

style='position:relative;z-index:10'

<div class="input-field m-b-30" style='position:relative;z-index:10'>
  <label for="cars">Choose a car:</label>
  <select name="cars" id="cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
  </select>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I am unable to see the last row of the table when I apply a condition after the table name

I need to display all the data from my table. However, if I include ORDER BY id DESC or any code after $sql="SELECT * FROM $tbl_name, the last row does not appear. <?php include "db.php"; $tbl_name="report"; // Table name $sql="SELECT * FROM $tbl_ ...

Using jQuery AJAX to send a URL as a string parameter

Currently, I have an ajax function that sends a string of variables to my script. However, there is one variable that needs to hold a complete URL along with parameters. In the current setup, var1 and var2 are received as $_POST variables. But I specifica ...

Using Bootstrap to align items to the right in a navigation bar

I've been attempting to align certain elements to the right in the navbar using Bootstrap by utilizing mr-auto, but it doesn't seem to be functioning properly. What steps should I take to ensure it works correctly? Below is a snippet of my index. ...

Comparing semi-direct file access with the use of an index.php controller

Hey there, I've been pondering a dilemma and would love some input. Although I've searched extensively, I haven't found a clear answer. Currently, my website is php-based and structured around a global index.php file that handles all reques ...

Automated logout feature will be enabled if no user interaction is detected, prompting a notification dialog box

Here is my working script that I found on this site. After a period of idle time, an alert message will pop up and direct the user to a specific page. However, instead of just the alert message, I would like to implement a dialog box where the user can ch ...

Storing array elements in a MySQL database through PHP and jQuery

Hello, I am in the process of populating a table by inserting multiple rows individually for each query. Here is the code snippet that shows how I am sending an array elements: The HTML markup: <form action="post.php" method="POST"> <h1>U ...

What is causing the Load More feature in jQuery to malfunction?

Attempting to create a basic "load more" feature using jquery. The concept is to mimic the functionality of traditional pagination where clicking loads additional posts from the database. Below is the javascript code: $(function(){ var count = 0; var ...

jQuery code unable to alter the class of a div

Need help with a script on my single page site that adds a "read more" style link to a content area's div. The goal is for the button to change the class of the content area when clicked, showing all of the content. Clicking again should hide the cont ...

Tips on efficiently rebinding jQuery events to dynamically loaded content without having to manually do it for each event or class

Recently, I encountered an issue with my jQuery app where I needed to bind different functions to elements within one div dynamically. Specifically, I had a "delete-function" attached to all ".btn-delete" elements and an "add-function" linked to all ".btn- ...

Ways to enlarge a YouTube thumbnail upon loading using JavaScript

I recently found a solution to my question on how to prevent YouTube videos from repeating even when different embedded codes are used. I have a specific need to resize the thumbnail image of my YouTube video to width:146px and height:124px when the page l ...

Despite functioning properly when triggered from the debug console, the jQuery AJAX request fails to work upon page load

The issue was resolved by disabling asynchronous requests in jQuery. Here is the Javascript & AJAX request (using jQuery) code on my page: "use strict"; var hsArea, counter, hotspots, count; counter = 4; count = 0; hotspots = {}; function fetchHots ...

Encountering challenges while integrating Angular with a Laravel forum creation project

Currently, I am working on building a forum application that involves users, posts, and comments using Laravel. However, the next step in my project requires integrating Angular, which is new territory for me and I'm not sure where to start. I have a ...

Dynamic loading of lists necessitates encapsulating nested lists

I'm currently working on a 3-level dropdown list that pulls content from a database for my project. I want the top level to resemble a tab menu, with a border surrounding the area underneath where the additional lists will appear. However, I am facing ...

Interact with the :before pseudo element when hovering over an element

Is there a way to manipulate the :before pseudo element when hovering over the main element? My goal is for the pseudo element to change its height when I hover over the main element. This is how my code looks: HTML <div class="object">& ...

Why isn't Jquery validate working for the day input?

I am facing an issue with a script that triggers only when I click on a textbox for the first time: var day = parseInt($("#day_birthdate").val(), 10); jQuery('input#day_birthdate').bind('input propertychange', function () { ...

Issues have arisen with the main background image in IE7 on ProLoser's AnythingSlider

Check out my website: Everything is working perfectly with AnythingSlider in all browsers except for IE7 - not really a surprise. The background image of the entire page seems to be offset differently depending on the browser size. After some investigatio ...

What is the best way to exclude blank fields when displaying a form for printing?

I have a form created using PHP. Although it displays correctly, I would like it to check each field and exclude any div/element/field that is left empty when I choose to print the form. Below is an example of the form code in the printable PHP file. If n ...

Is there a way to ensure that HTML5 audio is responsive when using Bootstrap?

I need help with making my HTML5 audio player responsive in Bootstrap. Here is the code I currently have: <div class="col-sm-4 col-sm-offset-4"> <audio controls style="width: 600px;"> <source src="sample.mp3"> < ...

Having trouble retrieving JSON data following file read operation

I've been on a quest to find a way to read JSON files using JavaScript. The tutorial that came the closest to what I needed is located here: https://gist.github.com/zuch/6224600. cells.json: { "cells": [ { "img": "img/singlestitch_thumb. ...

The styling of a CSS class in Internet Explorer may not be applied correctly if there are multiple elements sharing the same class name

For nearly a full week now, I've been plagued by a persistent issue! Here's the situation: I have 6 step tabs - step 1, step 2, and so on. Each tab has a CSS class called "locked" and "active." "Locked" - this style features top: 3em;, causing ...