How to maintain dropdown list after it selected through URL? - html

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.

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

How to use select inputs with Crowd HTML for mturk

I'm trying to set up a question with a select/dropdown for answers on mechanical turk, using Crowd HTML.
This is what I've got so far, but it doesn't give me a dropdown feature when testing, and it just appears as an ordinary text input. The documentation says this:
type
Takes a string to set the HTML5 input-type behavior for the input. Examples include file and date.
So based on this I think it should work but clearly no dice. Any ideas on how to do this? Thank you
<crowd-input name="qualificationType" type="select" required>
<option value="">High School</option>
<option value="">Some College</option>
<option value="">Associate Degree</option>
<option value="">Bachelor's Degree</option>
<option value="">Professional Degree</option>
<option value="">Master's Degree</option>
<option value="">Doctorate Degree</option>
</crowd-input>
A dropdown list is a select element, which you can use in mturk. Change what you have to:
<select name="qualificationType" required>
<option value="">High School</option>
<option value="">Some College</option>
<option value="">Associate Degree</option>
<option value="">Bachelor's Degree</option>
<option value="">Professional Degree</option>
<option value="">Master's Degree</option>
<option value="">Doctorate Degree</option>
</select>
And it should work

How to refer to a website with section tags (HTML)

If you have
<select>
<option value="val1">Teemo bot</option>
<option value="val2">Teemo mid</option>
<option value="val3">Akali mid</option>
</select>
How do I make it, when you click on one, it transfers you to another site.
you might want to use on change, since you are unable to select a option if first click redirects.
<select onchange="javascript:document.location=this.options[this.selectedIndex].value;">
<option value="http://google.com">Google</option>
<option value="http://stackoverflow.com/">Stackoverflow</option>
</select>

hide selected value of a select list, when list is open

I have a dropdown select list, from which I can choose a country. the first option is: choose your country.
<select>
<option selected disabled value=''>Choose your country</option>
<option value="1">Canada</option>
<option value="2">France</option>
</select>
But when I click to open the list, I can see choose your country in the options. Is there a way to hide this option from the list, and only show it as a placeholder before any selection is made?
Hides the default option from appearing in the list:
http://jsfiddle.net/ZT2ZV/
IMO the better solution would be to use something like: http://harvesthq.github.io/chosen/
<select>
<option value='' disabled selected style='display:none;'>Choose your country</option>
<option value="1">Canada</option>
<option value="2">France</option>
</select>
Use display:none; on your first value:
<select>
<option value="" selected disabled style="display:none;">Choose your country</option>
<option value="2">Canada</option>
<option value="3">France</option>
</select>
try http://jsfiddle.net/uaF93/

Drop-down lists for contact form

Is there a way to add an additional 'submenu' to a dropdown list on a contact form? So it would technically work like a drop-down navigation.
Below is the drop-down list for my contact form. And i've been asked to see if I can add additional options to lets say, Existing Partner. So when they hover over that item it expands to other options.
<label for="hear">How did you hear about us? </label>
<select class="contact-drop-down" name="hear" id="hear">
<option>Click to choose</option>
<option value="1">Existing Partner</option>
<option value="2">Word of mouth</option>
<option value="3">Brochure</option>
<option value="4">Email mailshot</option>
<option value="5">Google</option>
<option value="6">Yahoo</option>
<option value="7">Bing</option>
<option value="8">Other search engine</option>
<option value="9">Other</option>
</select>
You can't expand on hover with the standard select within HTML, but you can with either Javascript or HTML5 and CSS3.
This site has a list of 30 examples of HTML5 navigation menus and this site has a large selection of Javascript and JQuery examples.
Hopefully one of these might help you get what you want.
You can use optgroup tag for this.
<select>
<optgroup label="Existing Partners">
<option value="existing_partner_a">Partner A</option>
<option value="existing_partner_b">Partner B</option>
<option value="existing_partner_others">Others</option>
</optgroup>
</select>
No you cannot add sub menu to actual dropdown control. But you may find many custom controls.
Check out this
Saurabh Goyal above suggested to use . I also thought of suggesting the same. But is used for categorization & I dont think thats what you want.
Try optgroup for this .for example
<select>
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>