Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2008
    Posts
    680
    Thanks
    114
    Thanked 2 Times in 2 Posts

    Seeking Multiple Methods or Options

    Okay so I'm trying to come up with as many alternative methods to accomplish something. So I'm just seeking input from anyone who is willing to supply some.

    After the user clicks on a match type it'll know HOW MANY sides to the match there are so say for a singles match it'd have 2 sides (1 vs. 1) for a Triple Threat Match it'd have 3 sides (1 vs. 1 vs. 1) and so on. All matches have a stored field in the database of how many sides they have.

    So I'm thinking that I could have it create 3 divs (or something) down in the competitors area of how many sides there are in the match (separated by a VS. text block) and when the user selects a character from the dropdown and adds a character the user can maybe drag and drop the character's name to whatever side they choose.

    Its one idea. If you think of an EASIER more EFFICIENT way to do something like this and have an idea say something please or even if you can't let me know that you think it's a worth while idea.

    Code:
    <label for="matchtypedrop<?php echo $i+1 ?>">Match Type:</label>
                <select class="dropdown" name="matchtypedrop<?php echo $i+1 ?>" id="matchtypedrop<?php echo $i+1 ?>" title="Match Type <?php echo $i+1 ?>">
                    <option value="0">- Select -</option>
                   <?php
                    $query = 'SELECT id, matchtype FROM matchtypes';
                    $result = mysqli_query ( $dbc, $query ); // Run The Query
                    while ( $row = mysqli_fetch_array ( $result, MYSQL_ASSOC ) ) { 
                        print "<option value=\"".$row['id']."\">".$row['matchtype']."</option>\r";
                    }
                    ?>
                </select>
    
    <label for="competitors<?php echo $i+1 ?>">Competitors:</label><ul id="competitors<?php echo $i+1 ?>" style="list-style: none; margin-left: 195px;"></ul>
                <select class="dropdown" name="charactersdrop<?php echo $i+1 ?>" id="charactersdrop<?php echo $i+1 ?>" title="Characters Dropdown <?php echo $i+1 ?>" style="margin-left: 195px;">
                    <option value="0">- Select -</option>
                   <?php
                    $query = 'SELECT id, `character` FROM characters ORDER BY `character`';
                    $result = mysqli_query ( $dbc, $query ); // Run The Query
                    while ( $row = mysqli_fetch_array ( $result, MYSQL_ASSOC ) ) { 
                        print "<option value=\"".$row['id']."\">".$row['character']."</option>\r";
                    }
                    ?>
                </select>
                <input type="button" value="Add Character" class="" onclick="Competitors(<?php echo $i+1 ?>)"/>

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    How many competitors are in the pool of competitors??? It would be nice to use drag-n-drop, especially if you could drag/drop images or avatars. But if your pool of competitors is too large, you wouldn't able to show them all at the same time, so the drag/drop interface could get pretty clumsy.

    As an alternative, if you needed to "page" through many pages of pictures, you could just use CLICK to select the competitors and then have a second phase where you drag from the sub-pool to the playing space.

    If you've got maybe up to 100 or so competitors, then just supplying N <select>s seems reasonable, one for each "side" in the match. It would also be the most trivial to code.

    Anyway, seems to me it depends a lot on how many people are involved.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •