on 04-06-2006 3:32 PM
I've created a combo box to allow my users to filter the report. the only problem is that one of the selections is "#". The SAP example also shows this. I'd like to get rid of it using javascript. I put a span tag around the selections and I get the following:
<span id="selections">
<option value="!ALL" selected > (All) </option>
<option value="#" > "#" </option>
<option value="EP" > Enterprise Procurement </option>
<option value="RR" > Retail Reporting </option>
</span>
Anyone know of any javascript I can use to get rid of the "#" selection?
Thanks!
Got an answer from codingforums.com Thanks!
<HTML><HEAD>
<SCRIPT TYPE="text/javascript" LANGUAGE="javascript1.2">
function trimEntry()
{
/* Retrieve our select element, by name 'selections'
*/
var selElm = document.getElementsByTagName('SELECT')['selections'];
/* loop through it's options and find any that are set to '#', then
remove them
*/
for(var i = 0; i < selElm.length; i++) {
if(selElm<i>.value == '#') {
selElm.removeChild(selElm<i>);
}
}
}
</SCRIPT>
</HEAD>
<BODY ONLOAD="trimEntry();">
<SELECT id="selections" name="selections">
<option value="!ALL" selected > (All) </option>
<option value="#" > "#" </option>
<option value="EP" > Enterprise Procurement </option>
<option value="RR" > Retail Reporting </option>
</SELECT>
</BODY>
</HTML>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.