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 8895781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:52:42+00:00 2026-06-14T23:52:42+00:00

The following is the javascript code: <script language=JavaScript> function ShowHide(divId) { if(document.getElementById(divId).style.display == ‘none’)

  • 0

The following is the javascript code:

<script language="JavaScript">
    function ShowHide(divId)
    {
        if(document.getElementById(divId).style.display == 'none')
        {
            document.getElementById(divId).style.display='block';
        }
    }
</script>

This is the xhtml code to call the showhide function:

<p:column>
<p:commandLink onclick="javascript:ShowHide('HiddenDiv');" ajax="false" value="#{rail.trainNo}" action="#yardMaster.populateTrainDetails(rail.trainNo)}" style="font-family:Times New Roman, Times, serif;"></p:commandLink>
</p:column>

The above is the link which is supposed to unhide the following division:

<div style="display: none" id="HiddenDiv">
 Stuff
</div>

basically I’m trying to unhide a table in the div tag which is not displayed when the webpage is rendered for the first time. This is only half working, in the sense that when I click on the link it appears for a second or so and disappears immediately. What am I doing wrong??

  • 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-14T23:52:43+00:00Added an answer on June 14, 2026 at 11:52 pm

    Remove ajax="false". You don’t need to refresh the entire page just the given div. In your case when you click on the p:commandLink the div will be displayed but since ajax="false" the whole page is refreshed – which will display your div in its initial state.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have the following JavaScript code: <script type=text/javascript> function clearRadioButtons() { document.getElementById(radiobutton1).checked=; //etc
For the following code <script type=text/javascript> $(document).ready(function(){ $(#erase).click(function(){ confirm('Are you sure you want to
I got the following code : <script type=text/javascript> jQuery(document).ready(function(){ var Opened = false; jQuery('.expend-schedule').click(function(e){
I have the following JQuery code: <script type=text/javascript> $(document).ready(function () { var $containerHeight =
i have an aspx page containing following code <body> <script language=javascript type=text/javascript> function Hidee()
I'm using the following JavaScript code: <script language=JavaScript1.2 type=text/javascript> function CreateBookmarkLink(title, url) { if
I have the following JavaScript code: <script type='text/javascipt' language=javascript> function getUserLoc() { if (navigator.geolocation)
The following code is having some problem with the jQuery. <script type="text/javascript"> $(window).load(function() {
I have the following code <div class=framepage> <header> <script type=text/javascript> function getBaseUrl() { return
So I have code like this: <script language=javascript> $(function(){ function hellothere(strng){ showalert(strng); } function

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.