cancel
Showing results for 
Search instead for 
Did you mean: 

HTML/Javascript Help

sap_cohort
Active Contributor
0 Kudos

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="#"  > &quot;#&quot; </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!

Accepted Solutions (0)

Answers (1)

Answers (1)

sap_cohort
Active Contributor
0 Kudos

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="#" > &quot;#&quot; </option>
<option value="EP" > Enterprise Procurement </option>
<option value="RR" > Retail Reporting </option>
</SELECT>
</BODY>
</HTML>

Former Member
0 Kudos

Ki Ken

Nice work !!

-Doodle