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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:23:36+00:00 2026-05-26T02:23:36+00:00

This is probably a simple issue but i’m having a little trouble with it.

  • 0

This is probably a simple issue but i’m having a little trouble with it. I have created a form, this form uses php for validation of the fields. I have set-up an echo for the error message, this echos out in a pop-up window upon submission of the form.

On this pop-up there is a close button, i’ve added some javascript to this button to hide the div so the user can continue filling out the form fields that they missed. My only issue is… if the user submits the form again and it fails validation, the pop-up won’t load as it has been hidden.

How can I “temporarily” hide this div and reload it again upon submission? Here is my javascript code for the close button:

<script>
function checkClick(e) {
    var obj = e.srcElement;
    if (obj.id != 'pop-overlay')
        document.getElementById('pop-overlay').style.display = 'none';
    }
</script>

This is my call:

onClick="checkClick(event); return false;"

This is my php echo:

<?php
        if(!empty($errorMessage)) 
        {
            echo("<div id='pop-overlay'><ol>" . $errorMessage . "</ol><img class='close' src='images/close-btn.png' onClick='checkClick(event); return false;'/></div>");
        } 
    ?>
  • 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-05-26T02:23:36+00:00Added an answer on May 26, 2026 at 2:23 am

    I’m not sure I follow the page logic here, but if you want the div to show again on the same page, you would simply have to reshow the div with code like this:

    document.getElementById('pop-overlay').style.display = 'block';
    

    You would put this code wherever you want it to start showing again. If you need to remove the previous div from the page before you put a new one in the page, so that only the new one will show, then you can use this:

    var o = document.getElementById('pop-overlay');
    o.parentNode.removeChild(o);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Really having an issue debugging this...the reason why is probably very simple but I'm
This probably has a simple answer, but I must not have had enough coffee
This is probably a simple answer but I can't find it. I have a
I am having trouble doing something that is probably pretty simple! I have a
This is probably as simple as it gets, but I'm new to PHP and
This is probably a stupidly simple question, but I'm stuck. I had created a
I know this probably really simple but Im not sure what im doing wrong...
This is probably a simple question but I am not an ASP.NET developer and
This is probably a simple question, and I'm slightly embarrassed to ask it, but
This is probably a simple question but I can't seem to find the solution.

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.