Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8946863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:36:25+00:00 2026-06-15T12:36:25+00:00

My submenu doesn’t display after I add these lines line of code, what should

  • 0

My submenu doesn’t display after I add these lines line of code, what should I do instead?

Before I added this code, my submenu worked perfectly, the problem I suspect is window.onload.

The below code work perfectly with the result I want, but it create another problem for me which is my submenu doesnt display anymore

  window.onload = function() 
  {
    var element = document.getElementById('<%=lblMessage.ClientID%>');
    var lblMsg = document.getElementById('<%=lblAttention.ClientID%>');

    lblMsg.style.display = 'none';


    if(element.innerHTML.length)
        lblMsg.style.display = 'inline';
    else
        lblMsg.style.display = 'none';

}

the error msg shown in browser

javascript:__doPostBack('ctl00$m$g_0248855d_ee1a_4a57_9508_a520e1f7f8b9$ctl00$MenuReport','Report')
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:36:25+00:00Added an answer on June 15, 2026 at 12:36 pm

    Here is a suggestion

    Look at the page source

    If you have something like

    <body onload="somefunctiontoinitialisesubmenu()" ...>
    

    MOVE the code to the onload like this:

    window.onload = function() {
      var elem = document.getElementById('<%=lblMessage.ClientID%>');
      var lblMsg = document.getElementById('<%=lblAttention.ClientID%>');
      var html = elem.innerHTML;
      lblMsg.style.display = html.length!=-1?'inline':'none';
      somefunctiontoinitialisesubmenu();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create something that works like this but doesn't have any submenus.
I have a submenu that list departments. Behind this each department have an action
I need to add submenu to Appearance menu at WordPress like Background, Header, etc.
The click event should work fine: subMenu = $(.sub-menu) //.... subMenu.show() $(a.mobile).click (e) ->
I have the code below for showing a submenu. I want the submenu to
Via xml I can add submenu items to my action in the ActionBar .
i have the following code from my JSP which doesn't quite work: <%@ taglib
I have made some menu with a slide down submenu. It should work fine
I have a nav. When I hover some elements, the submenu should be displayed
Hey guy's I can't figure out why my code doesn't work when I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.