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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:19:01+00:00 2026-06-11T08:19:01+00:00

Update.. code works now had to change the validation statement on form submit. Removed

  • 0

Update..

code works now

had to change the validation statement on form submit. Removed the valid vars etc etc. but it works now Thanks

fixed onsubmit to

$('form').on("submit", function(e) {

            //Prevent default
            e.preventDefault();

                    if(validateName() & validateSubject() & validateEmail() & validateMessage())
                    {
                        $('form #status').removeClass().addClass('processing').html('Processing...').fadeIn('fast');

                        // maak variable met alle data die verstuurd kan worden
                        var formData = $('form').serialize();

                        //functie om data naar server te sturen
                        submitForm(formData);
                        return true;
                    }

                    else
                    {
                        $('form #status').removeClass().addClass('error')
                            .html('<strong>Form is not filled in correctly</strong>').fadeIn('fast')
                        return false;
                    }

            });
  • 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-11T08:19:03+00:00Added an answer on June 11, 2026 at 8:19 am

    Your problem is that you aren’t preventing the submission of your form. Instead, you’re hooking into the Submit button and then just showing an error message if there’s a problem (but the form gets submitted anyway so the error message isn’t helpful).

    There are a couple things you could/should do to solve this. First of all, you probably want to attach your validation code to the form’s submit event (rather than the submit button’s click event). This will ensure that if you offer other ways to submit the form in the future you won’t need to maintain the validation hooks on each method individually. So instead of:

    $('form #submit').click(function(e) {
    

    You probably want:

    $('form').on("submit", function(e) {
    

    Secondarily, if there’s a problem with the form, you want to return false in the submit handler. This will cause an implicit e.preventDefault(), which will stop the form from submitting:

    if (valid != '') {
        $('form #status').removeClass().addClass('error')
            .html('<strong>Correct these errors<BR></strong>' + valid).fadeIn('fast');
        return false; //stop form submission
        //Or you could do e.preventDefault(); if you're not ready to end the function yet.
    }
    

    That should resolve your most immediate issue. Keep at it!

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

Sidebar

Related Questions

After I click update in the grid view, the code works successfully. But when
UPDATE The issue is solved, all the code you can see works. Hello! I
I am trying to update code via Linq, but I am getting this error:
I am trying to use batch updates in Access VBA. My code works fine
I am using following steps to update code on server after login to server:
suppose you update your code to revision 10 which is broken. You want to
I'm trying to update my code to use cv2.SURF() as opposed to cv2.FeatureDetector_create(SURF) and
I have the following code: UPDATE myTable SET Col1 = @Value However, I have
I've had soooo much trouble getting this code to work properly!!!! It runs fine
Note: I had a previous similar question which I've now attempted to delete. I

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.