Points Distribution Script
2. Adding the Script
Join the Discussion
More of this Feature
The first step in using this script is to select the code from the text box below (there is a highlight all button beneath it to make this easier) and copy it into a file called sel.js.
The lines at the bottom of the script will need to be changed to match your particular points distribution requirements. The maxpts value should match the number of points that you are making available to be distributed (in my example there are 50 points available). Each pt[selbx++] value should be set to the number of points required for each of the available options to be selected in the order that they are going to be numbered in the form (in the example the options cost 5, 15, 35, and 30 points respectively).
You attach this updated script into your web page that that needs to perform the points distribution validation by adding the following code into the head section of your page.
</script>
Next we will look at the coding of the script and how to call the script in order to get it to detrermine whether enough points remain to allow the latest option to be selected.

