FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

How? : Javascript Select All [solved]

 


devroom
Hi

This is the code I use:
Code:
<select multiply size="10">
<option value=1>User 1</option>
<option value=2>User 2</option>
</select>


Now I want to make one checkbox which if selected, makes all users selected, and when deselected, makes all users deselect.

I searched with google, but I havent find anything yet.
Does somebody know the javascript code?

Thx in advance Wink

edit:
Code:
<script type="text/javascript">
function selAll(_v) {
  for(var i=1;i<document.writenew.userlist.length;i++)
    document.writenew.userlist [i].selected=_v;
}
</script>
<input type=\"button\" value=\"All\" onclick=\"selAll(true)\" />
<input type=\"button\" value=\"None\" onclick=\"selAll(false)\">

document.writenew.userlist
document.formname.selectmenuname
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.