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="#"  > "#" </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)

Former Member
0 Kudos

Hi,

If you are using a DDLB then in the event handler OnInitialization(), delete the seletion items of the table used for DDLB.

Hope this helps you, if not please revert back with more specifications.

Regards,

Shailaja

sap_cohort
Active Contributor
0 Kudos

Thanks for your reply! I totally didn't understand a word of your help.. So I must definately be in the wrong area....

this is what solved my problem

<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>