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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:28:46+00:00 2026-06-15T06:28:46+00:00

Relatively new to PHP here, but here’s where I’m at: I have a simple

  • 0

Relatively new to PHP here, but here’s where I’m at:

I have a simple PHP sort of email-sent validation going on, but after the page checks and confirms that the email is sent, I need to call Javascript (unless there is a better way to do this) to hide the DIV containing the email form to prevent spam.

Here’s my code:

<?php
  if (isset($_GET['sent']) === true) {
    echo '<div id="formAnswer"> Thanks for the email! </div>';
  }

  if (empty($errors) === false) {
    echo '<ul>';
    foreach($errors as $error) {
      echo '<li>', $error, '</li>';
    }
    echo '</ul>';
   }                
?>

I want to hopefully call a Javascript function to hide the div containing the email form based on the same IF statement that confirms the email was sent (I’d like to include setTimeout so that it’s very clear to the user that the confirmation DIV appears, and they can’t send another email from that page), but I can’t seem to get the Javascript to execute within an echo.

Any help?

  • 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-15T06:28:47+00:00Added an answer on June 15, 2026 at 6:28 am

    use document.getElementById(‘divid’);
    elem.parentNode.removeChild(elem)
    Delete the Div! to hide it 😀

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

Sidebar

Related Questions

Im relatively new to PHP but have realized it is a powerfull tool. So
I'm relatively new to php development but not to web development in general. I
I am relatively new to PHP, but experienced Java programmer in complex enterprise environments
This may be a silly question, but as someone relatively new to PHP, I'm
Im relatively new to the Android world but I have a quick question. I
I am relatively new to mod_rewrite, but have a site which I would like
I'm relatively new to web programming. New to Javascript, PHP, Ajax, etc. I have
I'm relatively new at PHP and came across a slight problem. I have a
I'm relatively new to PHP and have exhausted the internet trying to find an
I am relatively new to MySQL and PHP and I have been trying to

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.