My goal: To create a way of matching the prime factors of Ben Joffe’s Prime Number Factorizer with a range of nominated divisions, e.g. #1: 0-5, #2: 6-25, #3: 26-125, #4: 126-625, etc.
For example 3, 13, 251 are factors of 9789. 3 belongs to #1, 13 to #2 and 251 to #4. I plan to have ten groups in all. In this case 7 of them would have no matches. Five are featured below.
Each range is given a text profile with a text field revealing key words when a matching number is indicated. Manual selection seems the best option here.
Later commentary will be added to these when a report is produced on a “newwin” window.
It is important that only the comments of those numbers with matches appear on the report and not a list of “undefined” messages along with unwanted commentary.
Radio buttons allow for only one to be selected from a group. Checkboxes, however, seem ideal due to the multiple choice aspect.
I would be very grateful for any help resolving the above issues.
<HTML>
<HEAD>
<script = “text/javascript”>
<!–
function matchPrimes(df) {
var range1 = df.range1.value;
var comment1 = df.comment1.value;
if (df.range1.value == checked)
{df.comment1.value = “red herring”;}
else (df.range1.value == null) {
return false;
}
var range2 = df.range2.value;
var comment2 = df.comment2.value;
if (df.range2.value == checked)
{df.comment2.value = “hot dog”;}
else (df.range2.value == null) {
return false;
}
var range3 = df.range3.value;
var comment3 = df.comment3.value;
if (df.range3.value == checked)
{df.comment3.value = “talk turkey”;}
else (df.range3.value == null) {
return false;
}
var range4 = df.range4.value;
var comment4 = df.comment4.value;
if (df.range4.value == checked)
{df.comment4.value = “brass knobs”;}
else (df.range4.value == null) {
return false;
}
var range5 = df.range5.value;
var comment5 = df.comment5.value;
if (df.range5.value == checked)
{df.comment5.value = “Jack Frost”;}
else (df.range5.value == null) {
return false;
}
}
// –>
</script>
</HEAD>
<BODY>
<form>
<input type = “checkbox” name=”range1″> Between 0 and 5 <input type=”text” name=”comment1″ size=20><br>
<input type = “checkbox” name=”range2″> Between 6 and 25 <input type=”text” name=”comment2″ size=20><br>
<input type = “checkbox” name=”range3″> Between 26 and 125 <input type=”text” name=”comment3″ size=20><br>
<input type = “checkbox” name=”range4″> Between 126 and 625 <input type=”text” name=”comment4″ size=20><br>
<input type = “checkbox” name=”range5″> Between 626 and 3125 <input type=”text” name=”comment5″ size=20><br>
<input type = “button” name=”selectMatches” value=”Match” onClick=”matchPrimes(this.form)”>
</form>
</BODY>
</HTML> ?