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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:53:10+00:00 2026-05-28T19:53:10+00:00

I am trying to make my form display a dialog box (possibly via Javascript)

  • 0

I am trying to make my form display a dialog box (possibly via Javascript) upon successful submission of my form. How do I do this?

JS

<script type="text/javascript">
$.validator.setDefaults({
});

$().ready(function() {
    // validate alphaRegister form on keyup and submit
    $("#alphaRegister").validate({
        rules: {
            email: {
                required: true,
                email: true
            }
        },
        messages: {
            email: "*"
        }
    });
});
</script>

HTML

    <form id="alphaRegister" action="src/php/newSubscriber.php" method="post">
        <input type="email" name="email" id="cemail" value="" class="required" />
        <div style="float:right; margin:0 5px 2px 0;"><input type="submit" id="submit" name="submit" value="" /></div>
    </form>
  • 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-28T19:53:11+00:00Added an answer on May 28, 2026 at 7:53 pm

    Use your server side script to add a JS variable to your page once the form has been submited/processed and then in your $().ready function, check to see if this variable is set. If it is then display your dialog box.

    Update:

    To do this you will need to set a PHP variable formSubmitResult to true/false or 1/0 if it passes/fails your PHP validation routine.

    Then put this in the head of the page that you submit to:

    <script type="text/javascript">
    var submitIsValid=<?php echo formSubmitResult;?>;
    $().ready(function() {
     if(submitIsValid)
     {
      alert("Submission was valid!"); // or some code to open your custom dialog box
     }
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a page that takes a form submission and adds the
I am trying to display an image via powershell. I made a script based
I'm trying to make my contact form submission process work equally well whether the
I am trying to make this form: And this is what I get: (
I am trying to make a form in which the user fills in values.
I'm trying to make a form invisible for x amount of time in c#.
I am trying to make a form move (using the titlebar) from a button
I am trying to make a form field for a datetime property that allows
I'm trying to make an AJAX form that will update a twitter status when
Trying to make a custom :confirm message for a rails form that returns data

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.