Akky
12-22-2002, 10:19 AM
Hi Everybody
I have a interesting problem. This page given below will display two radio buttons, on click event will show an alert of the number of radio buttons(ie 2 in this case).
If I remove one of the radio buttons then the alert shows the length as undefined. I am adding the radio buttons dynamically and need to know the current numbers present
Any help is highly appreciated
Regards
Akky
<html>
<head>
<script language="JavaScript">
function radioSelected() { alert(document.searchFolderContents.search.length); }
</script>
</head>
<body>
<form method="post" action="" name="searchFolderContents">
<input type="radio" name="search" value="1" onclick="radioSelected()">
<input type="radio" name="search" value="2" onclick="radioSelected()">
</form>
</body>
</html>
I have a interesting problem. This page given below will display two radio buttons, on click event will show an alert of the number of radio buttons(ie 2 in this case).
If I remove one of the radio buttons then the alert shows the length as undefined. I am adding the radio buttons dynamically and need to know the current numbers present
Any help is highly appreciated
Regards
Akky
<html>
<head>
<script language="JavaScript">
function radioSelected() { alert(document.searchFolderContents.search.length); }
</script>
</head>
<body>
<form method="post" action="" name="searchFolderContents">
<input type="radio" name="search" value="1" onclick="radioSelected()">
<input type="radio" name="search" value="2" onclick="radioSelected()">
</form>
</body>
</html>