Jump to content

Compeitors Separation


Xtremer360

Recommended Posts

All of this code is from the same file. I'm trying to figure out how to accomplish this so if anyone has any opinions please suggest them as I'm lost as to the most efficient way to do this. This is what I have so far. What I'm attempting to do is after it gets the numSides variable established (used for match separation). The user will be able to select the competitors for both sides. As of right now I only have one dropdown and button that goes into the first UL but can anyone think of any other ways I could possibly do this or if this is a good way can anyone expand on this?

 

<div class="field required">
            <label for="competitors">Competitors:</label><ul id="competitors" style="list-style: none; margin-left: 195px;"></ul> VS. <ul id="competitors2" style="list-style: none; margin-left: 195px;"></ul> 
            <select class="dropdown" name="charactersdrop" id="charactersdrop" title="Characters Dropdown" style="margin-left: 195px;">
                <option value="0">- Select -</option>
               <?php
                $query = 'SELECT id, `character` FROM characters';
                $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()"/>
</div>

 

function matchSides() {
    var numSides = $('#matchtypesdrop option:selected').val();
    if (numSides > 0 ) {
        // Create the Vs. for separation.
        
    }else {
        
    }
}  

Link to comment
https://forums.phpfreaks.com/topic/222751-compeitors-separation/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.