Discussion on:

3
Comments

Join the conversation!

Follow via:
RSS
Email Alert
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.
0 Votes
+ -
Pro
Looking forward to working on some forms for my small business this weekend.
0 Votes
+ -
This could be a beneficial towards success.
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.