Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7027547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:15:45+00:00 2026-05-28T00:15:45+00:00

I have a table which contains user choices of a certain type… with each

  • 0

I have a table which contains user choices of a certain type… with each choice they can then categorise them in order of preference e.g. choice 1, choice 2, choice 3 etc. their first, second, third choices of all time

So, I have a list of all their choices which might be for example:

film name 1 :: choice 1

film name 2 :: choice 1

film name 3 :: choice 2

film name 4 :: choice 3

film name 5 :: choice 3

etc etc

What I want them to be able to do is click on their choice preference, e.g. their preference for film name 2, and it then change to a dropdown box to allow them to change it from choice 1 to choice 2, then when click choice 2 on the dropdown it updates the table and goes back to simple data listing. Obviously I want this functionality for every row displayed.

Is this possible? If so how? Are there any code/functions/classes written already for such functionality?

I use PHP with MySQL db

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:15:45+00:00Added an answer on May 28, 2026 at 12:15 am

    Yes this can be done, assuming you don’t care if it makes it difficult for users who can’t or don’t use a mouse. It’s not difficult with jQuery, though it shouldn’t be too much harder without. One approach would be to start with a hidden drop-down in all the appropriate places and then just show and hide them based on user actions. The other approach would be to append a drop-down when needed and remove it when finished.

    Following is a dodgy (but working: http://jsbin.com/ocogop/2/edit#javascript,html,live) implementation that I whipped up just as a proof of concept.

    <script>
    $(document).ready(function(){
      var choices = "<select class='choices'>"
                       +"<option value='Choice 1'>Choice 1</option>"
                       +"<option value='Choice 2'>Choice 2</option>"
                       +"<option value='Choice 3'>Choice 3</option>"
                       +"<option value='Choice 4'>Choice 4</option>"
                       +"</select>";
    
      $(".update").click(function() {
         var $this = $(this),
             currentChoice;
         // don't continue if there's already a select in this cell
         if ($this.find("select").length != 0)
            return;
         currentChoice = $this.html();
         var $choices = $(choices);
         $this.empty().append($choices);
         $choices.val(currentChoice);
      });
    
      $(document).on("change", ".choices", function() {
         var $this = $(this);
         $this.parent().html($this.val());
         return false;
      });
    });
    </script>
    
    <table id="list">
       <tr>
          <td>Film Name 1</td>
          <td class="update">Choice 1</td>
       </tr>
       <tr>
          <td>File Name 2</td>
          <td class="update">Choice 3</td>
       </tr>
       <!-- etc -->
    </table>
    

    This should get you started, though there are many ways it could be improved (I may well get comments telling me all the things I did “wrong”, but really I don’t have time right now to tidy it up). Note that the above uses .on() but for versions of jQuery older than 1.7 you should use .delegate().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table which contains User IDs, Period IDs and Qty: User Period
I currently have a user's table which contains a one-to-one relationship for Youtube OAuth
I have a table which contains my ads that can be searched in sql-server-2008.
I have one user table. and second language table which contains language that user
In my web-service i have a user table which contains column called HITS,now as
I have table Users which contains columns: id, name, points, extra_points. How can I
I have a SQL Server 2008 table which contains an external user reference currently
I have a sql server 2005 database which contains a user table.. Is it
I have a table called users which currently contains column money of type integer
We have a user table which contains all the users from the company. As

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.