Skip to Content

HTML/Javascript help

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!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Apr 06, 2006 at 09:01 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

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