Git Product home page Git Product logo

Comments (7)

acemir avatar acemir commented on June 12, 2024 1

@benlevywebdesign Setting .dk-option-selected to display: none; should resolve the issue.

from dropkick.

Robdel12 avatar Robdel12 commented on June 12, 2024

Hey @benlevywebdesign! Would you be able to apply a class to the selected option that hides it?

from dropkick.

benlevydesign avatar benlevydesign commented on June 12, 2024

@Robdel12 I updated my question.

from dropkick.

benlevydesign avatar benlevydesign commented on June 12, 2024

@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.

Robdel12 avatar Robdel12 commented on June 12, 2024

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.
image.

The selected part of dropkick should show the selected option. And then the list should have the selected option highlighted.

from dropkick.

benlevydesign avatar benlevydesign commented on June 12, 2024

It's on forms when I get the selected value from the database. See code below:
dropkick

<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?

dropkick2

or

40929904-f6cd1900-67da-11e8-8a63-c91f806f2cfb

from dropkick.

Robdel12 avatar Robdel12 commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.