Home : General : Internet Technologies :

General: Internet Technologies: Re: [Andy] Javascript - select all "select" values: Edit Log

Here is the list of edits for this post
Re: [Andy] Javascript - select all "select" values
Hi Andy

I've tried to adapt your JavaScript and this seems to work:

Code:

<html>
<head><title>Select-Test</title>

<script type="text/javascript">
function CheckAll () {
for (var i = document.Selecttest.Categories.length - 1; i >= 0; i--) {
document.Selecttest.Categories.options.selected = true;
}
}
</script>

</head>

<body>
<p>Categories: [ <a href="#" onclick="CheckAll();">select all</a> ]</p>

<form name="Selecttest">
<select size="9" name="Categories" multiple>
<option value="5">bar</option>
<option value="2">bla bla bkl </option>
<option value="3">dum de dar da</option>
<option value="6">dghfgd</option>
<option value="4">foo</option>
<option value="1">test</option>
</select>
</form>

</body>

</html>


Have a nice day and all the best
Smileliver

Last edited by:

olivers: Jul 24, 2007, 12:30 AM

Edit Log: