Comments (7)
@benlevywebdesign Setting .dk-option-selected
to display: none;
should resolve the issue.
from dropkick.
Hey @benlevywebdesign! Would you be able to apply a class to the selected option that hides it?
from dropkick.
@Robdel12 I updated my question.
from dropkick.
@acemir I want the selected option to stay. The selected option also shows up in the choices below the disabled placeholder option.
If the choices are: Choose One(placeholder), Yes, No, Maybe and the selected choice is "Yes" then I don't want to see "Yes, Choose One, Yes, No, Maybe".
See my first comment above.
from dropkick.
Oh wait, that's actually interesting. How does that happen? You're getting a duplicate of the selected option?
That looks to be the expected outcome I think.
.
The selected part of dropkick should show the selected option. And then the list should have the selected option highlighted.
from dropkick.
It's on forms when I get the selected value from the database. See code below:
<select class="selectoptions_ma" id="imageuploaded" name="imageuploaded">
<option selected value='<?php echo $imageuploaded ?>'> <?php echo ($imageuploaded == '1') ? Yes : No ?></option>
<option value="" disabled="disabled">Image Uploaded?</option>
<option value="1">Yes</option>
<option value="0">No</option>
</select>
How would I either make the selected value be from the order of the list or take it out and only show the non selected options below the placeholder?
orfrom dropkick.
Ahh, I see what you're going for now. From the example code you gave I'd write the select like this:
<select>
<option value="" disabled="disabled">Image Uploaded?</option>
<option <?php echo ($imageuploaded == '1') ? 'selected' : '' ?> value="1">Yes</option>
<option <?php echo ($imageuploaded == '0') ? 'selected' : '' ?> value="0">No</option>
</select>
That will have two selectable options in the list and it will select the right one given the value from the DB ($imageuploaded
).
from dropkick.
Related Issues (20)
- IE11 Issue: Change event. HOT 2
- Disabled state isn't relayed to the screen reader
- Multiselects on mobile are broken
- Disabled optgroup not detected
- Classes added to the combobox are removed on select HOT 4
- Select with all options disabled breaks HOT 1
- JAWS 17 not reading dropkick dropdown
- this object doesn't support this property or method dropkick HOT 1
- How to handle autocomplete
- This isn't really an issue, but HOT 1
- UglifyJS error because of ES6 HOT 8
- Not working on IE 11 HOT 2
- TypeError default is not a constructor HOT 5
- Cross-Origin blocking on forms using dropkick HOT 1
- Using an icon font displays unexpected results HOT 12
- toggleClass throws "is not a function" HOT 2
- Bubble Option not triggering change on the native select HOT 1
- Accessibility issue HOT 1
- Dropkick does not correctly handle selects with optgroups
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropkick.