• Resolved GMRobbins

    (@gmrobbins)


    I am using for American Football and considering the “Win Only” pick’em javascript located via this thread

    First, if I insert this code into my page and don’t get it to work, or it doesn’t perform as expected, will deleting the code revert all results, scores and player standings, back the way it was before?

    Second, you may think this crazy unless you’re familiar with an old weekly radio segment here in the South, how could the code be tweaked so that user’s pick the game’s loser? I assume it would be a simple change but my JS abilities would be considered a “loser” as well.

    Third, think the JS will work with the latest version of WP?

    Thanks once again for an awesome plugin.

    https://www.ads-software.com/plugins/football-pool/

Viewing 1 replies (of 1 total)
  • Plugin Author AntoineH

    (@antoineh)

    First, if I insert this code into my page and don’t get it to work, or it doesn’t perform as expected, will deleting the code revert all results, scores and player standings, back the way it was before?

    No, deleting the javascript will just return the plugin to its ‘normal’ state.

    Second, you may think this crazy unless you’re familiar with an old weekly radio segment here in the South, how could the code be tweaked so that user’s pick the game’s loser? I assume it would be a simple change but my JS abilities would be considered a “loser” as well.

    Just switch the 1 and 0 value in these lines:

    $this.siblings( '.score' ).find( 'input[name^="_' + team + '"]' ).val( '1' );
    $this.siblings( '.score' ).find( ':not(input[name^="_' + team + '"])' ).val( '0' );

    But one thing to remember is that only one script will work on a page with a form. So if you want to do both a pick a winner and a pick a losing team, you would have to make two pages with one of the javascripts on the page.
    Or, if you have two forms on one page, maybe you can make the jQuery selector more specific to point to the correct form or match rows. This one:
    jQuery( 'table.matchinfo.input tr' ).filter( function() {

    Third, think the JS will work with the latest version of WP?

    Yes, I think so. It’s just a piece of jQuery that does some ‘rework’ on the HTML of my plugin. But didn’t test it, though.

Viewing 1 replies (of 1 total)
  • The topic ‘Pick'em Loser?’ is closed to new replies.