|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Selct all items in a list box
Hi
I have a select box which is populated from database. i need to have a check box which when checked selects all the items in the select box. dynamic code is in asp. . Thanks in advance and urgent help required |
|
#2
|
||||
|
||||
|
This code works but has only been tested on IE:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Select all demo</title>
<script language="JavaScript">
function SelectAll() {
j = document.MyForm.MyMenu.length;
for (i=0; i<j; i++) {
document.MyForm.MyMenu[i].selected = true;
}
}
</script>
</head>
<body>
<form name="MyForm">
<select name="MyMenu" size="3" multiple>
<option value="Apple">Apple</option>
<option value="Banana">Banana</option>
<option value="Coffee">Coffee</option>
</select>
</form><a href="javascript:SelectAll();">Click here</a> to select everything above
</body>
</html>
__________________
selwonk |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Selct all items in a list box |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|