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.
Page 5 of 7 FirstFirst ... 34567 LastLast
Results 61 to 75 of 92
  1. #61
    New Coder
    Join Date
    Feb 2010
    Posts
    74
    Thanks
    9
    Thanked 0 Times in 0 Posts
    i have been reading over this thread for like a week now lol, great script. I know it was made last year, but im hoping to get it working this year, if the thread is still active.... anyway

    this is what i got so far: http://tomhilsee.com/ipool/create-bracket.php

    but im having trouble posting the data on the next page to the db
    the code im using in insert_data.php is below

    Code:
    <?php
    
    // Start a session
    session_start();
    
    ######################### DB CONNECT ###########
    
    
    // Database settings
    // database hostname or IP. default:localhost
    // localhost will be correct for 99% of times
    define("HOST", "localhost");
    // Database user
    define("DBUSER", "****");
    // Database password
    define("PASS", "******");
    // Database name
    define("DB", "ipool");
     
    /// Make the mysql connection
    $conn = mysql_connect(HOST, DBUSER, PASS) or die('Could not connect !Please contact the site\'s administrator.');
    
    $db = mysql_select_db(DB) or die('Could not connect to database !Please contact the site\'s administrator.');
    
    
    
    ######################### PICKS ###########
    
    $pick1_1 = $_POST["pick1_1"];
    $pick1_2 = $_POST["pick1_2"];
    $pick1_3 = $_POST["pick1_3"];
    $pick1_4 = $_POST["pick1_4"];
    $pick1_5 = $_POST["pick1_5"];
    $pick1_6 = $_POST["pick1_6"];
    $pick1_7 = $_POST["pick1_7"];
    $pick1_8 = $_POST["pick1_8"];
    $pick1_9 = $_POST["pick1_9"];
    $pick1_10 = $_POST["pick1_10"];
    $pick1_11 = $_POST["pick1_11"];
    $pick1_12 = $_POST["pick1_12"];
    $pick1_13 = $_POST["pick1_13"];
    $pick1_14 = $_POST["pick1_14"];
    $pick1_15 = $_POST["pick1_15"];
    $pick1_16 = $_POST["pick1_16"];
    $pick1_17 = $_POST["pick1_17"];
    $pick1_18 = $_POST["pick1_18"];
    $pick1_19 = $_POST["pick1_19"];
    $pick1_20 = $_POST["pick1_20"];
    $pick1_21 = $_POST["pick1_21"];
    $pick1_22 = $_POST["pick1_22"];
    $pick1_23 = $_POST["pick1_23"];
    $pick1_24 = $_POST["pick1_24"];
    $pick1_25 = $_POST["pick1_25"];
    $pick1_26 = $_POST["pick1_26"];
    $pick1_27 = $_POST["pick1_27"];
    $pick1_28 = $_POST["pick1_28"];
    $pick1_29 = $_POST["pick1_29"];
    $pick1_30 = $_POST["pick1_30"];
    $pick1_31 = $_POST["pick1_31"];
    $pick1_32 = $_POST["pick1_32"];
    
    
    
    
    
    ?>
    i only did it for the first round wins just to see if i could get it to post. (i have the db setup, but the values just arent showing up in their respective fields.

    any help would be appreciated, thanks
    Last edited by thilss0o; 02-28-2010 at 04:27 PM.

  2. #62
    Regular Coder
    Join Date
    Jan 2007
    Posts
    142
    Thanks
    9
    Thanked 1 Time in 1 Post
    I dont see an INSERT.

  3. #63
    New Coder
    Join Date
    Feb 2010
    Posts
    74
    Thanks
    9
    Thanked 0 Times in 0 Posts
    ah ok, where and how do i need that written?

  4. #64
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thilss0o did you get this working? Your site looks like it is up and running, but I wasnt sure. Quick question, what do you use for the login system? Is that easy to replicate? Easy to remove? I haven't gone to far into it, but I thoguth I'd ask before I started digging around. Thanks!

    And thanks to everyone who put this together. I was Googling long and hard to find the answer for this. I'm planning on using it for college hockey's frozen four. It's adapt perfectly.

  5. #65
    New Coder
    Join Date
    Feb 2010
    Posts
    74
    Thanks
    9
    Thanked 0 Times in 0 Posts
    yes i have it up and running at tomhilsee.com/ipool

    feel free to browse around and see how it works. also feel free to join the pool xD

    the login system i used is extremely easy to replicate, follow this tutorial and you should be good to go. Its very easy to work with and modify. http://www.ineedtutorials.com/code/p...m-php-tutorial

    I did some changes to it to get rid of the activation email (i hate those) and to have it register your full name and display that instead of the username. and then for the brackets to be submitted with the full name of the username that is already logged in and show your brackets on your account page.

    if you have any trouble, or want some specifics about the whole system, send me an email. thilsee@idealizedesigns.com Its way too much code on too many pages to post it here.

    (i'm not very clean with my code, and i dont know how to make the automated url tags, so there is an abundance of uneccesary pages) but it works all the same

  6. #66
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,438
    Thanks
    75
    Thanked 4,372 Times in 4,337 Posts
    Now what you really need is an automated system that stores the user's choices in a DB and then scores their choices, maybe after each round, so that people can see where they stand in the pool.

    Too late to do this for this year's March Madness, but maybe I'll actually get around to it for next year. But I'll probably write it in ASP or ASP.NET, so all you PHP people will have to translate the code. <grin/>
    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.

  7. #67
    New Coder
    Join Date
    Feb 2010
    Posts
    74
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    Now what you really need is an automated system that stores the user's choices in a DB and then scores their choices, maybe after each round, so that people can see where they stand in the pool.

    Too late to do this for this year's March Madness, but maybe I'll actually get around to it for next year. But I'll probably write it in ASP or ASP.NET, so all you PHP people will have to translate the code. <grin/>
    i wrote such a script, er adapted it, and it actually counts it after each game for each bracket. the only thing the admin needs to do is update the official bracket in the db. its not the cleanest code, but ill post a link and people can try and sort through it to figure it out

    here is a txt file that has all the code i used for my entire standings page (also has a 'who picked who' for each game)

    see it in action here: http://tomhilsee.com/ipool/standings.php

  8. #68
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,438
    Thanks
    75
    Thanked 4,372 Times in 4,337 Posts
    Hmmm...just in time for June Madness. <grin/>

    Not bad at all. No point in going a lot beyond that for something you only use once a year.
    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.

  9. #69
    New Coder
    Join Date
    Feb 2010
    Posts
    74
    Thanks
    9
    Thanked 0 Times in 0 Posts
    its fun tho i don't get into any other project as much as i do my march madness site btw. i didnt do the code now, i did it before the tournament lol, i'm just posting it now

    but hey who knows, maybe i can move to canada and make it a profitable site ( with some more work of course )

  10. #70
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mbrewer View Post
    unrelenting - I don't check that all fields are complete before submitting because I allow for people to submit picks without filling out all fields and then they can come back later and finish or change their picks up until the first game on Thursday. The getvalues() function onsubmit gets all of the values and puts them in to the hidden fields whether they are empty or not.

    There is something wrong with the getvalues() function that you are using and that is why you aren't getting the data on the next page. Start with the following and shorten it using for loops if you like.

    function getvalues(winner) {
    winner.form.pick1_1.value = winner.form.elements["WIN1_1"].value;
    winner.form.pick1_2.value = winner.form.elements["WIN1_2"].value;
    winner.form.pick1_3.value = winner.form.elements["WIN1_3"].value;
    winner.form.pick1_4.value = winner.form.elements["WIN1_4"].value;
    winner.form.pick1_5.value = winner.form.elements["WIN1_5"].value;
    winner.form.pick1_6.value = winner.form.elements["WIN1_6"].value;
    winner.form.pick1_7.value = winner.form.elements["WIN1_7"].value;
    winner.form.pick1_8.value = winner.form.elements["WIN1_8"].value;
    winner.form.pick2_1.value = winner.form.elements["WIN2_1"].value;
    winner.form.pick2_2.value = winner.form.elements["WIN2_2"].value;
    winner.form.pick2_3.value = winner.form.elements["WIN2_3"].value;
    winner.form.pick2_4.value = winner.form.elements["WIN2_4"].value;
    winner.form.pick3_1.value = winner.form.elements["WIN3_1"].value;
    winner.form.pick3_2.value = winner.form.elements["WIN3_2"].value;
    winner.form.pick4_1.value = winner.form.elements["WIN4_1"].value;
    }

    I tested it and it outputted all the correct values - http://www.myterrio.com/test.php
    Hi guys i have taken this Bracket but i dont know how to create a php file for this... pls explain..

  11. #71
    New Coder
    Join Date
    Feb 2010
    Posts
    74
    Thanks
    9
    Thanked 0 Times in 0 Posts
    gocodes, you have to post the values the javascript is grabbing and then insert them into a database, like this:

    PHP Code:
    <?php


    $pick1_1 
    $_POST['pick1_1'];
    $pick1_2 $_POST['pick1_2'];
    $pick1_3 $_POST['pick1_3'];
    $pick1_4 $_POST["pick1_4"];
    $pick1_5 $_POST["pick1_5"];
    $pick1_6 $_POST["pick1_6"];
    $pick1_7 $_POST["pick1_7"];
    $pick1_8 $_POST["pick1_8"];
    $pick1_9 $_POST["pick1_9"];
    // etc. etc.

    mysql_connect ("localhost""USERNAME""PASSWORD") or die ('Could not connect');
    mysql_select_db ("DBNAME");

    $query="INSERT INTO TableName 

    (ID, pick1_1, pick1_2, pick1_3, pick1_4, pick1_5, pick1_6, pick1_7, pick1_8, pick1_9) VALUES ('NULL', '"
    .$pick1_1."', '".$pick1_2."', '".$pick1_3."', '".$pick1_4."', '".$pick1_5."', '".$pick1_6."', '".$pick1_7."', '".$pick1_8."', '".$pick1_9."')";

    mysql_query($query) or die ('Your bracket was not submitted to the database.  Try again or contact us.');

    echo 
    "success";

    ?>

  12. #72
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by thilss0o View Post
    gocodes, you have to post the values the javascript is grabbing and then insert them into a database, like this:

    PHP Code:
    <?php


    $pick1_1 
    $_POST['pick1_1'];
    $pick1_2 $_POST['pick1_2'];
    $pick1_3 $_POST['pick1_3'];
    $pick1_4 $_POST["pick1_4"];
    $pick1_5 $_POST["pick1_5"];
    $pick1_6 $_POST["pick1_6"];
    $pick1_7 $_POST["pick1_7"];
    $pick1_8 $_POST["pick1_8"];
    $pick1_9 $_POST["pick1_9"];
    // etc. etc.

    mysql_connect ("localhost""USERNAME""PASSWORD") or die ('Could not connect');
    mysql_select_db ("DBNAME");

    $query="INSERT INTO TableName 

    (ID, pick1_1, pick1_2, pick1_3, pick1_4, pick1_5, pick1_6, pick1_7, pick1_8, pick1_9) VALUES ('NULL', '"
    .$pick1_1."', '".$pick1_2."', '".$pick1_3."', '".$pick1_4."', '".$pick1_5."', '".$pick1_6."', '".$pick1_7."', '".$pick1_8."', '".$pick1_9."')";

    mysql_query($query) or die ('Your bracket was not submitted to the database.  Try again or contact us.');

    echo 
    "success";

    ?>
    No m8...
    i was taken that script and added in html webpage and uploaded to site...
    in the script i can see

    <form action="insert_picks.php" method="post">
    that means i have to make insert_picks.php file with ur added script in that...
    thats all.. ?

  13. #73
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this wat i did

    My html page
    Code:
    <html>
    <head>
    <style>
    *     { font-family: arial; font-size: 12px; }
    th    { border: solid black 3px; background-color: white; font-size: 16px; }
    .team { border: solid black 2px; background-color: white; width: 120px; height: 24px; }
    .team2 { border: solid black 2px; background-color: white; width: 120px; height: 24px; }
    .team3 { border: solid red 2px; background-color: yellow; width: 120px; height: 24px; }
    </style>
    <script>
    function win(winner)
    {
    var team = winner.value;
    var levels = winner.name.substring(3).split("_");
    var curlevel = parseInt(levels[0]);
    var curgame = parseInt(levels[1]);
    
    var nextlevel = curlevel + 1;
    var nextgame = Math.floor( (curgame+1) / 2 );
    
    var curteam = winner.form.elements["WIN"+nextlevel+"_"+nextgame].value;
    var winnerButton = winner.form.elements["WIN"+nextlevel+"_"+nextgame];
    if ( winnerButton == null ) return;
    
    ++nextlevel;
    nextgame = Math.floor( (nextgame+1) / 2 );
    var nextButton = winner.form.elements["WIN"+nextlevel+"_"+nextgame];
    var forward = ( nextButton != null && nextButton.value == winnerButton.value );
    
    winnerButton.value = team;
    while ( forward ) {
    nextButton.value = " ";
    ++nextlevel;
    nextgame = Math.floor( (nextgame+1) / 2 );
    nextButton = winner.form.elements["WIN"+nextlevel+"_"+nextgame];
    forward = ( nextButton != null && nextButton.value == curteam );
    }
    } 
    
    function getvalues(winner) 
    {
        var frm = winner.form;
        for ( var e = 0; e < frm.elements.length; ++e )
        {
            var fld = frm.elements[e];
            if ( fld.name.substring(0,3) == "WIN" && fld.name.substring(0,4) != "WIN0" )
            {
                 frm.elements["pick" + fld.name.substring(4)].value = fld.value;
            }
       }
    }
    </script>
    
    </head>
    <body>
    <form action="insert_picks.php" method="post">
    <table border=0 cellpadding=0>
    <tr>
    	<th colspan=4 style="font-size: x-large;">West Region</th>
    	<th colspan=3 style="font-size: x-large;">2009 NCAA Basketball Tournament</th>
    </tr>
    <tr>
    	<th colspan=1>1st Round</th>
    	<th colspan=1>2nd Round</th>
    	<th colspan=1>Sweet 16</th>
    	<th colspan=1>Elite 8</th>
    	<th colspan=1>Final 4</th>
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_1" onclick="win(this)" value="#1 Seed"></td>
    </tr>
    <tr>
        <td></td>
        <td><input type=button class="team" name="WIN1_1" id="WIN1_1" onclick="win(this)" value="<?php echo $pick1_1; ?>"><input type="hidden" name="pick1_1" id="pick1_1">
    </td>
        
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_2" onclick="win(this)" value="#16 Seed"></td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><input type=button class="team2" name="WIN2_1" id="WIN2_1" onclick="win(this)" value="<?php echo $pick2_1; ?>"><input type="hidden" name="pick2_1" id="pick2_1">
    </td>
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_3" onclick="win(this)" value="#8 Seed"></td>
    </tr>
    <tr>
        <td></td>
        <td><input type=button class="team" name="WIN1_2" id="WIN1_2" onclick="win(this)" value="<?php echo $pick1_2; ?>"><input type="hidden" name="pick1_2" id="pick1_2">
    </td>
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_4" onclick="win(this)" value="#9 Seed"></td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><input type=button class="team2" name="WIN3_1" id="WIN3_1" onclick="win(this)" value="<?php echo $pick3_1; ?>"><input type="hidden" name="pick3_1" id="pick3_1">
    </td>
    </tr>
    <tr>
    	
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_5" onclick="win(this)" value="#4 Seed"></td>
    </tr>
    <tr>
        <td></td>
        <td><input type=button class="team" name="WIN1_3" id="WIN1_3" onclick="win(this)" value="<?php echo $pick1_3; ?>"><input type="hidden" name="pick1_3" id="pick1_3">
    </td>
    
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_6" onclick="win(this)" value="#13 Seed"></td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><input type=button class="team2" name="WIN2_2" id="WIN2_2" onclick="win(this)" value="<?php echo $pick2_2; ?>"><input type="hidden" name="pick2_2" id="pick2_2">
    </td>
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_7" onclick="win(this)" value="#5 Seed"></td>
    </tr>
    <tr>
        <td></td>
        <td><input type=button class="team" name="WIN1_4" id="WIN1_4" onclick="win(this)" value="<?php echo $pick1_4; ?>"><input type="hidden" name="pick1_4" id="pick1_4">
    </td>
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_8" onclick="win(this)" value="#12 Seed"></td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><input type=button class="team3" name="WIN4_1" id="WIN4_1" onclick="win(this)" value="<?php echo $pick4_1; ?>"><input type="hidden" name="pick4_1" id="pick4_1">
    </td>
    </tr>
    <tr>
    	
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_9" onclick="win(this)" value="#3 Seed" ></td>
    </tr>
    <tr>
        <td></td>
        <td><input type=button class="team" name="WIN1_5" id="WIN1_5" onclick="win(this)" value="<?php echo $pick1_5; ?>"><input type="hidden" name="pick1_5" id="pick1_5">
    </td>
    
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_10" onclick="win(this)" value="#14 Seed" ></td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><input type=button class="team2" name="WIN2_3" id="WIN2_3" onclick="win(this)" value="<?php echo $pick2_3; ?>"><input type="hidden" name="pick2_3" id="pick2_3">
    </td>
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_11" onclick="win(this)" value="#6 Seed" ></td>
    </tr>
    <tr>
        <td></td>
        <td><input type=button class="team" name="WIN1_6" id="WIN1_6" onclick="win(this)" value="<?php echo $pick1_6; ?>"><input type="hidden" name="pick1_6" id="pick1_6">
    </td>
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_12" onclick="win(this)" value="#11 Seed" ></td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><input type=button class="team2" name="WIN3_2" id="WIN3_2" onclick="win(this)" value="<?php echo $pick3_2; ?>"><input type="hidden" name="pick3_2" id="pick3_2">
    </td>
    </tr>
    <tr>
    	
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_13" onclick="win(this)" value="#2 Seed" ></td>
    </tr>
    <tr>
        <td></td>
        <td><input type=button class="team" name="WIN1_7" id="WIN1_7" onclick="win(this)" value="<?php echo $pick1_7; ?>"><input type="hidden" name="pick1_7" id="pick1_7">
    </td>
    
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_14" onclick="win(this)" value="#15 Seed" ></td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><input type=button class="team2" name="WIN2_4" id="WIN2_4" onclick="win(this)" value="<?php echo $pick2_4; ?>"><input type="hidden" name="pick2_4" id="pick2_4">
    </td>
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_15" onclick="win(this)" value="#7 Seed" ></td>
    </tr>
    <tr>
        <td></td>
        <td><input type=button class="team" name="WIN1_8" id="WIN1_8" onclick="win(this)" value="<?php echo $pick1_8; ?>"><input type="hidden" name="pick1_8" id="pick1_8">
    </td>
    </tr>
    <tr>
        <td><input type=button class="team" name="WIN0_16" onclick="win(this)" value="#10 Seed" ></td>
    </tr>
    <tr>
    	
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    
    
    </table>
    <input name="Submit" type="submit" value="Submit" onClick="getvalues(this)">
    </form>
    </body> 
    </html>
    My Insert_picks.php file

    Code:
    <?php
    
    
    $pick1_1 = $_POST['pick1_1'];
    $pick1_2 = $_POST['pick1_2'];
    $pick1_3 = $_POST['pick1_3'];
    $pick1_4 = $_POST["pick1_4"];
    $pick1_5 = $_POST["pick1_5"];
    $pick1_6 = $_POST["pick1_6"];
    $pick1_7 = $_POST["pick1_7"];
    $pick1_8 = $_POST["pick1_8"];
    $pick1_9 = $_POST["pick1_9"];
    // etc. etc.
    
    mysql_connect ("localhost", "edgecode_gocodes", "atgmatgm") or die ('Could not connect');
    mysql_select_db ("edgecode_code");
    
    $query="INSERT INTO TableName 
    
    (ID, pick1_1, pick1_2, pick1_3, pick1_4, pick1_5, pick1_6, pick1_7, pick1_8, pick1_9) VALUES ('NULL', '".$pick1_1."', '".$pick1_2."', '".$pick1_3."', '".$pick1_4."', '".$pick1_5."', '".$pick1_6."', '".$pick1_7."', '".$pick1_8."', '".$pick1_9."')";
    
    mysql_query($query) or die ('Your bracket was not submitted to the database.  Try again or contact us.');
    
    echo "success";
    
    ?>
    Am getting a error message

    Your bracket was not submitted to the database. Try again or contact us

    Can any one give me a complete solution cos am not a coder, i was like to host a Tournament
    My website
    www.eng.guildportal.com but for tournament alone i have to make one site.. using a free hosting..
    i tested as much i can.... ((

  14. #74
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know this is a bit old of a post now, but how would I change the javascript noted here to use images instead of buttons. Therefore passing on the image source and a value or id?

  15. #75
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,438
    Thanks
    75
    Thanked 4,372 Times in 4,337 Posts
    Just use images in place of the names, if you use my original code as the basis:
    Code:
    <tr>
        <td class="team" onclick="win(this,1)"><img src="Amherst.jpg" alt="Amherst"></td>
    </tr>
    <tr>
        <td></td>
        <td class="team" id="WIN1" onclick="win(this,33)">&nbsp;</td>
    </tr>
    <tr>
        <td class="team" onclick="win(this,1)"><img src="BowlingGreen.jpg" alt="Bowling Green"></td>
    </tr>
    And then the win() function doesn't even have to be changed, because it already copies the winner's innerHTML to the next level, so now it would copy the <img....> instead of the team name. Voila.

    When posting to a server-side processing page, you'd need to collect all the winner names by looking at the alt= values of the various images, but that's easy enough:
    Code:
         winner[i] = document.getElementById("WIN"+i).getElementsByTagName("img")[0].alt;
    Last edited by Old Pedant; 01-29-2011 at 10:04 PM.
    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.


 
Page 5 of 7 FirstFirst ... 34567 LastLast

Tags for this Thread

Posting Permissions

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