How to check if an html object exist
Posted on 2005-04-21
Let's say i have 1 to 4 dynamically generated checkboxes. The checkboxes use the same name, and the number of checkboxes depend on some database values. Now i want to add validation to these checkboxes. I need to make sure at least one of them is checked, I'm thinking along these lines:
checkedFlag = 0
if (isObject(document.MyForm.MyChkBox[i])) //how can i check if this is an object??
checkedFlag = 1