How to remove the bottom input field? - html

I am working on a form in which user needs to select the country. User can select his/her country by searching on the input field or by selecting from the dropdown.
All of the countries are shown in dropdown so I've removed them for the purpose to post minimized code.
<div class="form-group">
<label for="country">Country </label>
<input list="country" name="country">
<datalist class="form-control" id="country">
<option value="Virgin Islands (Brit)">
<option value="Virgin Islands (USA)">
<option value="Wake Island">
<option value="Wallis & Futana Is">
<option value="Yemen">
<option value="Zaire">
<option value="Zambia">
<option value="Zimbabwe">
</datalist>
</div>
An screenshot of the current state is here:
The form shouldn't have that extra input field below the Country label. The field isn't accessible.

Your code is correct.
This is using your code
Maybe there is another code that you don't know.
You can inspect element your code by press f12 button
I hope my answer can help you

Related

Not displaying correct option in drop-down menu

I created a drop down list with links. It works properly except when I go back one page, then instead of the option which is 'selected' in the HTML, it shows the option I had navigated to. I would like it to reset, so that the page I'm on is the one being displayed when the list is collapsed. How can I fix this?
<div id="drop">
<select name="year" id="year" onchange="location = this.value;">
<option value="sermons-2023.html"selected>2023</option>
<option value="sermons-2022.html">2022</option>
<option value="sermons-2021.html">2021</option>
<option value="sermons-2020.html">2020</option>
<option value="sermons-2019.html">2019</option>
<option value="sermons-2018.html">2018</option>
<option value="sermons-2017.html">2017</option>
<option value="sermons-2016.html">2016</option>
<option value="sermons-2015.html">2015</option>
</select>
</div>
You have to save the value with js in localstoreg and then after returning to the previous page you can see that the value is the same

form with multi select option and a search box

i'm creating a tour site where people can select a number destination, date, number of children and the price range to see if that type of a tour is available, then redirects to that page to preview and sign up. how can i set up that using a multi select option and a search box,?
This is the simple html form but i can't expand on this
<select class="mdb-select colorful-select dropdown-primary md-form" multiple searchable="Search here..">
<option value="" disabled selected>Choose your country</option>
<option value="1">USA</option>
<option value="2">Germany</option>
<option value="3">France</option>
<option value="4">Poland</option>
<option value="5">Japan</option>
</select>
<label class="mdb-main-label">Label example</label>
<button class="btn-save btn btn-primary btn-sm">Save</button>
you can use this jquery plugin to implement multi select option in html using jquery:
https://developer.snapappointments.com/bootstrap-select

How to maintain dropdown list after it selected through URL?

for example I have this URL
http://oursite.com/WebSite5/production/ReportPage.aspx?name=&office=VTM
on dropdown list VTM is selected, but in unable to select another option.
How can I maintain the dropdown list item like this?
Follow this code to add a dropdown link like as second image
<label for="country">Country:</label>
<select name="country" id="countryselect">
<option value="0" selected disabled>Select Your Country</option>
<option value="Sri Lanka"> Sri Lanka</option>
<option value="Qatar"> Qatar</option>
<option value="Moldova (Republic of)"> Moldova (Republic of)</option>
<option value="Korea (Democratic People's Republic of)"> Korea (Democratic People's Republic of)</option>
<option value="Åland Islands"> Åland Islands</option>
</select>
You can use a selected attribute to Add always selected option and disable attribute mean it can't select to user.

Is it possible for a datalist to have scrolldown?

I'm new to HTML and trying to use a datalist. I need to limit it to display only 5 items and the rest to be viewed using scrolldown. Is there any way?
My code :
<form>
<input list="Android" name="Android">
<datalist id="Android">
<option value="Alpha">
<option value="Beta">
<option value="Cupcake">
<option value="Doughnut">
<option value="Eclairs">
<option value="Fryo">
<option value="GingerBread">
<option value="HoneyComb">
<option value="Icecream Sandwich">
<option value="Jelly Bean">
<option value="Kitkat">
<option value="Lollipop">
<option value="Marshmallow">
<option value="Nougat">
</datalist>
<input type="submit">
</form>
This is the output of my code
Thanks in advance!
Well, that's not possible to do, the datalist layout is defined by the browser the same as it does with the select tag and there is very little flexibility on customization. Your example comes from Chrome; in Firefox, it shows only 6 items and on Edge it shows something similar with limited size as well.
The proposed solution is using something else rather that using datalist, if you can't live with the datalist design Chrome offers, try some other component with a similar behavior, like dropdown select, autocomplete, autosugest, typeahead, etc.

Bootstrap multiselect issue

I was trying to add bootstrap multi select in http://teddyslist.com/dev/index.php. I have added multi select in the second drop down only. Previously bootstrap select was there. After adding multi select, the design has been broken.
The default label "--Select State--" is not showing now. Currently it is showing "Nothing Selected". How to change it?
The checkbox is also showing beside "--Select State--". How to delete it from here?
My code is something like below.
JQUERY in header :
$(document).ready(function(){
$('#state').multiselect();
});
HTML :
<select name="state" id="state" multiple>
<option value="">-- Select State --</option>
<option value="1">111</option>
<option value="2">222</option>
<option value="3">333</option>
</select>
I have included bootstrap-multiselect.js and bootstrap-multiselect.css.
Can anyone please help me? Please excuse if I ask any silly question.
change as the multiple="multiple" in html
<select name="state" id="state" multiple="multiple">
<option value="">-- Select State --</option>
<option value="1">111</option>
<option value="2">222</option>
<option value="3">333</option>
</select>