Discussion on:

Message 1 of 3
4 Votes
+ -
why hardcode the checkboxes?
I wonder if you would have more flexibility if the checkbox elements were dynamically generated at page load. You could have a data source (e.g. the site's database, or an XML file) holding all the names of checkboxes and which article ID each one is associated with, and then for each ID-checkbox pair generate a checkbox with some javascript like so:

function addCheckboxToForm(articleID,checkboxName)
{
var checkBox = document.CreateElement("input");
checkBox.type = "checkbox";
checkBox.name = articleID.concat("_",checkboxName);
var content = document.GetElementById(articleID)
content.appendChild(checkBox);
}

That way if you have to add or remove some names from the database, you don't have to change the HTML.
Posted by sigilToNoise
14th Feb