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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:17:19+00:00 2026-06-07T17:17:19+00:00

I am struggling here.. Need some help!! :) I have a PHP and need

  • 0

I am struggling here.. Need some help!! 🙂

I have a PHP and need to run a jquery .show inside an echo when a submit button is pressed.. Any help will be greatly appreciated..

The PHP Code >

<?php
                        $name = $_POST['name'];
                        $email = $_POST['email'];
                        $title = $_POST['title'];
                        $content = $_POST['content'];
                        $from = 'From: Comeone Form'; 
                        $to = 'info@someemail.com'; 
                        $subject = 'Contact Form';
                        $human = $_POST['human'];

                        $body = "From: $name\n E-Mail: $email\n Subject: $title\n Message:\n $content";

                    if ($_POST['submit'] && $human == '4') {                 
                    if (mail ($to, $subject, $body, $from)) { 
                            echo '<p>Your email has been successfully sent!</p>';
                    } else { 
                            echo '<p>Something went wrong, go back and try again!</p>'; 
                            } 
                    } else if ($_POST['submit'] && $human != '4') {
                            echo '<script>
$("submit-mail").click(function () {
$("#mail-message-window").show("slow");
});
</script>';
                            }
                    ?>

The FORM >

<form method="post" action="#contact-us">
                        <label>Name *</label>
                        <input type="text" name="name" class="rounded" required />
                        <label>E-mail *</label>
                        <input type="email" name="email" class="rounded" required />
                        <label>Subject *</label>
                        <input type="text" name="title" class="rounded" required />
                        <label>Message *</label>
                        <textarea name="content" cols="42" rows="7" class="rounded" required></textarea>
                        <label>What is 2+2? (Anti-spam) *</label>
                        <input type="text" name="human" class="rounded" required />
                        <input id="submit" name="submit" id="submit-mail" type="submit" class="submit-btn rounded" value="SEND">
                    </form>

The Hidden DIV >

<div id="mail-message">
                        <table>
                            <tr>
                                <td>
                                    <div id="mail-message-window">
                                        <div id="mail-message-header"></div>
                                        <p id="mail-failure">Unable to send your email!</p>
                                        <p id="invalid-email">Please enter valid email address!</p>
                                        <p id="empty-field">Please fill out all the fields in order to send us a message.</p>
                                        <p id="mail-success">Your email has been successfully sent to us!</p>
                                        <input type="button" id="mail-message-btn" class="mail-message-btn rounded" value="OK" />
                                    </div>
                                </td>
                            </tr>
                        </table>

the CSS >

#mail-message
{
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    width: 100%;
    height: 100%;
    z-index: 210;
}
#mail-message
{
    width: 100%;
    height: 100%;
    text-align: center;
}
#mail-message-window
{
    width: 400px;
    padding-bottom: 20px;
    border: solid 0px #ffffff;
    background: #000000 url('../images/bg.png') repeat top left;
    margin: 0 auto;
}
#mail-message-header
{
    width: 400px;
    height: 70px;
}
.mail-message-success
{
    background: transparent url('../images/success.png') no-repeat top left;
}
.mail-message-error
{
    background: transparent url('../images/error.png') no-repeat top left;
}
#mail-message-window p
{
    margin: 0 0 5px 10px;
    text-align: left;
}
#mail-message-window input
{
    margin-top: 10px;
}
#mail-message td
{
    vertical-align: middle;
}
  • 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-07T17:17:21+00:00Added an answer on June 7, 2026 at 5:17 pm

    Instead of

    $("#mail-message-window").show("slow");
    

    you need

    $("#mail-message").show("slow");
    

    Because from CSS it seems display: none; is set to #mail-message but not to mail-message-window.

    If you want to use $("#mail-message-window").show("slow"); then set display:none to #mail-message-window instead of #mail-message.

    Note

    You should use $(document).ready(function() { ... }), in short $(function() { .. }) to wrap you all jQuery code.

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

Sidebar

Related Questions

Ello, I am struggling with some date troubles here in PHP/MySql. I have a
here's an easy one (that I'm struggling with)! I have a textarea, a button,
I'm a python novice and am struggling with some concepts here - any help
I'm struggling for a pattern here. I have quite a few tasks that need
I need some help with an app i'm making using MapKit I'm struggling with
I'm struggling with a RegEx, and I hope to find some guidance here. I
I have been struggling with this for months in my project. Here's the deal:
I've looked through some posts around here, but am still struggling to get my
I am struggling with custom toc items added via: \addcontentsline{toc}{section}{Some text here} Actually my
I need to create some global android variables. Some posts here suggested me 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.