15
Views
4
Comments
Solved
JavaScript Menu Search 
Question

Hai All 

     I am Using in my web Application Multiple menu And Also SubMenus  My Problem Is I was Using JavaScript For My Menu Search Option But My Script Is Not Working Any One Give Some Solution 

This My Script


  var input, filter, ul, li, a, i;

  input = document.getElementById("texvar");

  filter = input.value.toUpperCase();

  ul = document.getElementById("PageLinks");

  li = ul.getElementsByTagName("Submenu");

  for (i = 0; i < li.length; i++) {

    a = li[i].getElementsByTagName("a")[0];

    if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {

      li[i].style.display = "";

    } else {

      li[i].style.display = "none";

    }


  }







    

Rank: #90
Solution

Hi Selva,

I have updated your oml. And its working.

your are taking JS reference from here

https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_search_menu 

and here design pattern is different from OS design.


Hope this will help you


Regards

Rahul Sahu

EnterpriceResourceProjectfrom.oml

mvp_badge
MVP
Rank: #56

Hi Selva ,

Is it possible for you to share the sample oml just with the menu thing , it will help us solving this issue quickly. Also did you check in browser console if there is any error coming?


Regards,

-PJ-

Rank: #1890

Hai Pramod Jainmvp


I will Share My Oml Sheet FYR 

Regards 

Selva

EnterpriceResourceProjectfrom.oml

Rank: #90
Solution

Hi Selva,

I have updated your oml. And its working.

your are taking JS reference from here

https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_search_menu 

and here design pattern is different from OS design.


Hope this will help you


Regards

Rahul Sahu

EnterpriceResourceProjectfrom.oml

Rank: #1890

Hai Ragul 

Thanks It Will work 


regards

selva