1. Tech

Your suggestion is on its way!

An email with a link to:

http://javascript.about.com/library/bllotto1.htm

was emailed to:

Thanks for sharing About.com with others!

Lotto Picker

The Script

clr gif
Join the Discussion

Questions? Comments?

More of this Feature

Lotto Picker

The page that I wrote about the lotto picker script that selects a specified number of unique numbers from a larger set of numbers was mainly intended to illustrate how a few array methods can be used in combination to produce a rather involved effect in very few statements. The form at the bottom of the page was just intended to demonstrate how the code could be used. So of course you all want copies of the form to put on your own site.

So this code is in two parts, the Javascript and the form code for the page (three parts if you include the necessary script tag to link the Javascript into your page). So if you want a copy of that form to put on your site the first thing that you need to do is to copy the following Javascript.

Once you have copied the code you just save it to an external javascript file. I called mine pick.js. You then link it into the head of your page using the following code:

<script type="text/javascript" src="pick.js">
</script>

The other code that you need is the HTML for the lotto picker form itself. Simply copy the following code into your page where you want the lotto picker form to appear.

©2014 About.com. All rights reserved.