Any ideas on what kind of wizardry on the drop down box?
What I want is similar to selecting all records. I have that. But, I want an option to select all records except those with a particluar ID number.
For example, the drop-down box has these 4 options:
All
1
2
3
I want to create a new option (called "Not 3") that will display only the results for 1 and 2.
I am not sure I understand the question but the JavaScript is one of the following depending on what you are doing.
If you want to refresh a select list then something AJAX-y. So really just the other solution streamy mentioned with added bloat.
Or if you want to show hide data based on changing a select then something that uses spans or other suitable HTML elements with style attributes for display of either hider or show.
A simple example
<html>
<head>
<script type="text/javascript">
function doMagic(){
var ele = document.all["s1"];
if(document.test.example.selectedIndex==0){
ele.style.display = "none";
}else{
ele.style.display = "block";
}
}
</script>
</head>
<body>
<form name="test">
<select name="example" onchange="doMagic()">
<option>Hide
<option>Show
</select>
<span id="s1" style="background-color: #FFFFDD; width:300px; display: none;">
Dum de dum
</span>
</form>
</body>
</html>
Here is a sample of the code I want to update:
<select name="statSel" >
<option value="*" ><%=FormsBean.getStatSel().equals("*") ? "selected" : ""%> >All</option>
<option value="1" ><%=FormsBean.getStatSel().equals("1") ? "selected" : ""%> >1</option>
<option value="2" ><%=FormsBean.getStatSel().equals("2") ? "selected" : ""%> >2</option>
<option value="3" ><%=FormsBean.getStatSel().equals("3") ? "selected" : ""%> >3</option>
</select>
I want to create a new option that has the value of "Not3" that if selected will display all of the results that do not have a value of 3.