Some Common Javascript
Iterating Form elements – checkboxes
for(i=0;i<document.myform.elements.length;i++)
{
if(document.myform.elements[i].type == “checkbox”)
{
if(document.myform.elements[i].checked)
{
alert(document.myform.elements[i].name);
}
}
}//end of for loop
Selecting 3rd option in a dropdown
document.myform.mycomb0.selectedIndex = 2;
No comments yet.
Leave a comment
-
Archives
- March 2008 (7)
- February 2008 (2)
-
Categories
-
RSS
Entries RSS
Comments RSS