Designing two tables considering following scenario.

  • I want to design two tables considering the following scenario. Consider the image below:

     

    Screenshot 2024-04-08 200000

     

    I’m moving blue boxes (which shows up on screen after Show Options the button is clicked) from left to right (on the grid) after clicking Move Text Content! button. Here are the steps I follow:

    1. Select one option from the Select options dropdown.
    2. Select a color from the dropdown.
    3. Click the Show Options button
    4. Enter a row and column (For example A and 1) and then click calculate Hit the Move Text Content! button to move blue boxes on the grid.

     

    So, once "Move Text Content!" button is clicked, I want to save the information in the database tables. Let's say if my actual select statement is the following for discussion purpose:

    <select> <option value="101">Capricorn</option> <option value="102">Aquarius</option> <option value="103">Pisces</option> <option value="104">Aries</option> <option value="105">Taurus</option> <option value="106">Gemini</option> <option value="107">Cancer</option> <option value="108">Leo</option> <option value="109">Virgo</option> <option value="110">Libra</option> <option value="111">Scorpio</option> <option value="121">Sagittarius</option> </select>

    Selecting Capricon produces 4 HTML elements like following:

    Capricon#1
    Capricon#2
    Capricon#3
    Capricon#4

    IS the following design okay?

    I'm thinking about having an OptionsTabe where id is a primary key and valueID will store the value of Capricon

    Screenshot 2024-04-08 200626

     

    And then the SeectedOptions table would contain other details like this:

    Screenshot 2024-04-08 200706

    Here optionsID is the primary key of above table. Here is my working code in case anyone is interested in playing around with it.

  • You working code link leads to a "Run this fiddle" link.  I cancelled from there.

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Yes, the link I shared requires to click that button so that it can run the code in a full screen mode. It's in a "show" mode (as you can see towards the end of the URL here: https://jsfiddle.net/c107jfdn/show) .

    Here is another link that won't ask you to click anything : https://jsfiddle.net/c107jfdn

    But it won't show in full screen.

     

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply