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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:14:28+00:00 2026-06-06T09:14:28+00:00

Upon submit I am trying to have quiz hide and have thanks be shown.

  • 0

Upon submit I am trying to have “quiz” hide and have “thanks” be shown. All was working correct until I added a JavaScript form validation code, and now it just reloads the first div “welcome” I thought adding “#thanks” to the action upon submit would solve the issue, but it did not. Then trying to add an “if true” statement to my form validation ended up breaking the form validation. I am using jquery.validate to validate my form as suggested. With the current code it skips the validation and just shows “thanks” If anyone has any suggestions it would be greatly appreciated.

    <div id="quiz">
        <form class="cmxform" id="commentForm" method="get" action="" onSubmit="showHide(); return false;">
             <label for="cname">Name</label>
             <input id="cname" name="name" size="20" class="required" minlength="2" />
           </p>
           <p>
             <label for="ccompany">Company Title</label>
             <input id="ccompany" name="company" size="20"  class="required company" minlength="2" />
           </p>
           <p>
             <label for="cnumber">Phone Number</label>
             <input id="cnumber" name="number" size="20"  class="required number" />
           </p>
           <p>
             <label for="cemail">Email</label>
             <input id="cemail" name="email" size="20"  class="required email" />
         <p></p>   
    <input class="submit" type="submit" value="Submit" align="center"/>
    </form>
    </div> 

  <div id="thanks"><h2>Thank you.</h2>
You will receive an email momentarily
</div>

   <script>
$("#begin").click(function(){
    $("#quiz").show();
    $("#welcome").hide();    
});
 function showHide(){
    $("#thanks").show();
    $("#quiz").hide();    
};

</script>
  • 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-06T09:14:29+00:00Added an answer on June 6, 2026 at 9:14 am

    All I can say is that you are doing it wrong…. While the form validation that you are doing can work there are a lot of good form validation jquery plugins that would both simplify your life and add a much richer user experience. jquery.validate is probably the most widely used library and would be well worth using.

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

Sidebar

Related Questions

I have a form which I want to submit upon button click which is
I have an input field in a form. Upon pushing submit, I want to
I have a form with lots of data. There is a Submit button. Upon
I'm trying to submit a form which contains dynamic elements that were added to
I have a ASP.Net MVC form that upon submit I need a couple of
There are many sites which call a script upon form submit and pass in
I'm trying to use the jQuery Autocomplete function to submit a form when an
I have a form embedded in a web page. When the user clicks submit
What I'm trying to do: user fills out a form data, clicks submit. user
I'm trying to have some jquery change a hidden form value on my page

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.