This is most likely pretty simple..
I need a function that when a link or button is clicked, all the checkboxes will become checked
Much like a 'check all' button on a lot of webpage mail systems like yahoo, hotmail etc
an onClick function
Moderator: General Moderators
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
yo,
usually you have a function that references the items u want to change the property from
make sure your elements have ids
if u want to change the property of more than 1 element u need to reference these elements by id's and relate the property u want to change.
since in your case its a group of check buttons u may want to do a loop throug to check all the check buttons else again u need to reference the buttons whose property u want to change
usually you have a function that references the items u want to change the property from
Code: Select all
<script>
function Change_Property(){
// get a reference to the element. usually a form element
var formelement = document.formsї0].formElementID;
// then change the property or value
formelement.checked = true; in this case itss a check button
}
</script>
// then apply the function to your links
<a herf="e;#"e; onClick = "e;Change_Property"e;>check buttons</a>if u want to change the property of more than 1 element u need to reference these elements by id's and relate the property u want to change.
since in your case its a group of check buttons u may want to do a loop throug to check all the check buttons else again u need to reference the buttons whose property u want to change