let's hear it for insomnia...
[php]
<html>
<head>
<script language="JavaScript" type="text/javascript">
function removeIP(v)
{
// remove IP address from list
document.ipForm.ipList[v] = null;
// if no IP addresses are in the list, a message is displayed
if (document.ipForm.ipList[0] == null)
{
// increase the number of options by 1
++document.ipForm.ipList.length;
// add message to the option
document.ipForm.ipList[0].text = "no IP's blocked";
}
}
function addIP(v, l)
{
// if no IP addresses are in the list, adds new as first entry
if (document.ipForm.ipList[0].text == "no IP's blocked")
{
// replaces message with new option
document.ipForm.ipList[0].text = v;
}
// if there are IP addresses in the list, adds new to bottom
else
{
// increase the number of options by 1
++document.ipForm.ipList.length;
// add text to the new option
document.ipForm.ipList[l].text = v;
}
}
</script>
</head>
<body>
<form name="ipForm" method="post">
<select name="ipList" size="10">
<option>192.168.254.2</option>
<option>192.168.254.3</option>
<option>192.168.254.4</option>
</select>
<a href="javascript
:removeIP(document.ipForm.ipList.s electedIndex)">Remove</a>
<br> <br>
<input type="text" name="add_ip">
<a href="javascript
:addIP(document.ipForm.add_ip.valu e, document.ipForm.ipList.length)">Add</a>
</form>
</body>
</html>
[/php]
see it in
action
sosa just hit a hr!!!!!! go cubbies.