David-
XMOD is a great module -- I use it all the time. It has its quirks but overall is a rock-solid performer. I actually have a blog post dealing with tips for 508 compliance in XMOD forms on my "to-do" list ("languishing on my to-do list" is a bit more accurate).
Below are changes to the sample HTML page you linked that will let you get rid of your "form" tag. This is not the most versatile (or code efficient) way of doing things but it will get you going with relatively small changes to the flow of your existing sample code.
Good luck with the XMOD and JavaScript. While you're still getting your feet wet in JS, remember that W3SCHOOLS is your friend.
Cheers!
-mamlin
Changes to sample HTML at: http://old.privilegesgroup.co.uk/YourLifeEvaluator.html
Change 1: Replace everything inside your script tags with:
function anyCheck()
{
var CareerTotal = 0;
// Get collection of elements with name "Career"
var CareerCol = document.getElementsByName('Career');
var FinancesTotal = 0;
var FinancesCol = document.getElementsByName('Finances');
var MyTimeTotal = 0;
var MyTimeCol = document.getElementsByName('MyTime');
var HealthTotal = 0;
var HealthCol = document.getElementsByName('Health');
var RelationshipsTotal = 0;
var RelationshipsCol = document.getElementsByName('Relationships');
var GrowthTotal = 0;
var GrowthCol = document.getElementsByName('Growth');
var TotalScore = 0;
for (var idx = 0; idx < CareerCol.length; idx++) {
if (eval("CareerCol[" + idx + "].checked") == true) {
CareerTotal += 1;
}
}
for (var idx = 0; idx < FinancesCol.length; idx++) {
if (eval("FinancesCol[" + idx + "].checked") == true) {
FinancesTotal += 1;
}
}
for (var idx = 0; idx < MyTimeCol.length; idx++) {
if (eval("MyTimeCol[" + idx + "].checked") == true) {
MyTimeTotal += 1;
}
}
for (var idx = 0; idx < HealthCol.length; idx++) {
if (eval("HealthCol[" + idx + "].checked") == true) {
HealthTotal += 1;
}
}
for (var idx = 0; idx < RelationshipsCol.length; idx++) {
if (eval("RelationshipsCol[" + idx + "].checked") == true) {
RelationshipsTotal += 1;
}
}
for (var idx = 0; idx < GrowthCol.length; idx++) {
if (eval("GrowthCol[" + idx + "].checked") == true) {
GrowthTotal += 1;
}
}
TotalScore = CareerTotal + FinancesTotal + MyTimeTotal + HealthTotal + RelationshipsTotal + GrowthTotal
Career: " + CareerTotal + ", Finances: " + FinancesTotal + ", My Time: " + MyTimeTotal + ", Health: " + HealthTotal +
", Relationships: " + RelationshipsTotal + ", Growth: " + GrowthTotal + ", TOTAL: " + TotalScore);
}
Step 2: Changes to HTML
Change your "form" tags to plain "div" with nothing else inside (no attributes). You don't really need the "div" for this example to work but it's good practice to enclose things inside a root container element (see general XHTML guidelines). You page would normally be within "HTML" tags as the root container but I understand your example is to be placed within a DNN module (Text/HTML module or an XMOD form) so you don't want "HTML", "BODY" or "form" tags included in your code.