Inside the selectBox dropdown list style not working - drop-down-menu

This is my markup; when I style the option tag it will not take any style properties.
<form>
<select>
<option value='Select Reason'>
Select Reason
</option>
<option value='Select Reason' >
Select Reason
</option>
<option value='Select Reason' >
Select Reason
</option>enter code here
</select>
</form>

Related

How to create Select2 Multiple value using Bulma in Laravel

I want to create select function on my laravel project , this Select is select2 multiple like on this doc link . on bulma documentation this select multiple is not have function javascript code . only like this :
<div class="select is-multiple">
<select multiple size="8">
<option value="Argentina">Argentina</option>
<option value="Bolivia">Bolivia</option>
<option value="Brazil">Brazil</option>
<option value="Chile">Chile</option>
<option value="Colombia">Colombia</option>
<option value="Ecuador">Ecuador</option>
<option value="Guyana">Guyana</option>
<option value="Paraguay">Paraguay</option>
<option value="Peru">Peru</option>
<option value="Suriname">Suriname</option>
<option value="Uruguay">Uruguay</option>
<option value="Venezuela">Venezuela</option>
</select>
</div>
can someone help how to create this select2 so we can add more than 1 value on this field select ?

is it possible to add label tag inside option?

I'm trying to do something like this on the dropdown
I already tried different tag but failed to see the expected
<option id="makeDefault" value="0">Make <label class="option-placeholder">e.g. BMW, Mercedes</label></option>
Try this:
<select>
<option value="" disabled selected hidden>MAKE e.g. BMW...</option>
<option value="0">list item 1</option>
<option value="1">list item 2</option>
</select>
FIDDLE: https://jsfiddle.net/L0k6x0dh/1/

How do you select options in a dropdown using capybara?

I am trying to use capybara to target a value within a dropdown menu that lives within an iframe. Here is the HTML for the dropdown that I am trying to select:
<select class="colored required" aria-required="true" id="birthdate-month" name="birthdate-month" aria-label="Birth Month">
<option value="">Month</option>
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
Here is the step definition I have written to try and target that dropdown menu and select an option within it:
find('#birthdate-month').find(:xpath, 'option[06]').select_option
When I run this, I get:
'Unable to find css "#birthdate-month" (Capybara::ElementNotFound)'.
Any ideas on what I'm doing wrong? Thanks!
EDIT:
I got it to work by inserting this into my step definition
browser = page.driver.browser
browser.switch_to.frame(iframe_name)
step(step)
browser.switch_to.default_content

Multiple selection of dropdown menu and direct to a link

I am looking for JavaScript or in jquery for my custom dropdown menu
<form name="menu">
<select ONCHANGE="location = this.options[this.selectedIndex].value;">
<option value="" selected="selected">Courses</option>
<option value="http://www.google.com">Course1</option>
<option value="http://www.youtube.com">Course2</option>
<option value="http://www.yahoo.com">Course3</option>
</select>
<select ONCHANGE="location = this.options[this.selectedIndex].value;">
<option value="" selected="selected">Location</option>
<option value="http://www.google.com">Location1</option>
<option value="http://www.youtube.com">Location2</option>
<option value="http://www.yahoo.com">Location3</option>
</select>
</form>
http://jsfiddle.net/kundansingh/d4FEV/2/
in this if i select any of the course and then the location it should redirect to a paticular url, so for each course, different locations will be there and url
Follow steps:
Just pass the value(url) to a javascript function as an argument.
Grab that value in that javascript function.
Redirect the url (might use window.location.assign(url) function)`

Unable to select a option using select in RSpec/Capybara

Hi I'm fairly new to using Ruby/Capybara and RSPEC...I'm trying to select the month from a dropdown selectbox with value like the following
<legend> Expiration Date </legend>
</div>
<ul>
<li class="select input required"
id="cart_driver_attributes_credit_card_attributes_exp_month_input">
<select autocomplete="off" class="required select-box expiration-date"
id="cart_driver_attributes_credit_card_attributes_exp_month"
name="cart[driver_attributes][credit_card_attributes][exp_month]">
<option value="">Month</option>
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
========================================================================
I'm using the following to select the month
select "August", :from => "select"
I tried several ways to select a month, but I keep getting Capybara::ElementNotFound:
The :from option accepts id, name or label of the select (documentation). So in your case:
select "August", :from => "cart_driver_attributes_credit_card_attributes_exp_month"

Resources