Results 1 to 2 of 2

Thread: Lottery Picker

  1. #1
    Join Date
    Mar 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Lottery Picker

    1) Script Title: Lottery Picker

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex12/lottery.htm

    3) Describe problem: Hello friends,
    I need a help to adapt this script as follows:
    I need it to generate 50 different lines with 15 dozen each, with dozens going 01-25.

    I appreciate the help already ...

  2. #2
    Join Date
    Mar 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    After many attempts to get the script to create several simultaneous lines, however are equal.
    Could someone help me make them become different when clicking the button?

    Thx!

    Code:
    <head>
    
    <STYLE>
    TD {
    FONT-FAMILY: Arial;
    FONT-SIZE: 10pt;
    HEIGHT: 15pt;
    TEXT-ALIGN: center
    }
    </STYLE>
    
    <style type="text/css">
    .a1{
    position:relative;
    font-family:Verdana;
    font-size:20px;
    color:#888888;
    }
    </style>
    
    <script language="JavaScript">
    
    /*****************************************
    * Lottery Picker (By Kurt at kurt.grigg@virgin.net)
    * Featured on/available at http://www.dynamicdrive.com/
    * Modified by DynamicDrive.com for below config options
    * This notice must stay intact for use.
    *****************************************/
    
    var totalnumbers=15 //input total numbers to generate
    var lowerbound=1   //input lower bound for each random number
    var upperbound=25  //input upper bound for each random number
    
    function lotto(){
    B=' ';	
    LottoNumbers=new Array();	
     for (i = 1; i <= totalnumbers; i++)
     {
     RandomNumber = Math.round(lowerbound+Math.random()*(upperbound-lowerbound));
      for (j = 1; j <= totalnumbers; j)
      {
      if (RandomNumber == LottoNumbers[j])
        {
         RandomNumber=Math.round(lowerbound+Math.random()*(upperbound-lowerbound));
         j=0;
        }
      j++;
      }
     LottoNumbers[i]=RandomNumber;
     }
    LottoNumbers=LottoNumbers.toString();
    X=LottoNumbers.split(',');
     for (i=0; i < X.length; i++)
     {
     X[i]=X[i]+' ';
     if (X[i].length==2) 
     X[i]='0'+X[i];
     } 
    X=X.sort();
     for (i=0; i < X.length; i++)
     {
     OutPut=B+=X[i];
     }
    if (document.all)document.all.layer1.innerHTML=OutPut;
    if (document.getElementById)document.getElementById("layer1").innerHTML=OutPut;
    if (document.layers)
    {
      document.layers.layer1.document.open();
      document.layers.layer1.document.write("<span style='position:absolute;top:0px;left:0px;font-family:Verdana;font-size:20px;color:#888888;text-align:center'> "+OutPut+"</span>");
      document.layers.layer1.document.close();
      }
    if (document.all)document.all.layer2.innerHTML=OutPut;
    if (document.getElementById)document.getElementById("layer2").innerHTML=OutPut;
    if (document.layers)
    {
      document.layers.layer2.document.open();
      document.layers.layer2.document.write("<span style='position:absolute;top:0px;left:0px;font-family:Verdana;font-size:20px;color:#888888;text-align:center'> "+OutPut+"</span>");
      document.layers.layer2.document.close();
      }
      T=setTimeout('lotto()',20);
    //window.status=OutPut;
    }
    function StOp(){
    setTimeout('clearTimeout(T)',1000);
    }
    //-->
    </script>
    
    </head>
    Code:
    <body>
    
    <center>
    <table border='0' width=750 height=50>
    <tr valign='middle'>
    <td align='center'>
    <form name=form>
    <input type=button value='Gerar Numeros' onClick="lotto();StOp()">
    </form><br /><br />
    <span id=layer1 class=a1>Resultados</span><br />
    <span id=layer2 class=a1>Resultados</span>
    </td>
    </tr>
    </table>
    </center>
    
    </body>

Similar Threads

  1. Lottery Numbers Generator Issues in IE
    By shellshock30 in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 11-19-2010, 01:29 PM
  2. About Lottery Picker
    By pangetkah002 in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 12-03-2008, 02:34 PM
  3. Time Picker
    By ritesh_sail in forum JavaScript
    Replies: 7
    Last Post: 09-10-2008, 04:15 AM
  4. Lottery Picker Script-Justification
    By kgilbert in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 12-28-2006, 11:44 PM
  5. California Super Lottery Plus Number Picker
    By cucunusa in forum Submit a DHTML or CSS code
    Replies: 0
    Last Post: 09-10-2006, 07:58 PM

Bookmarks

Posting Permissions

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