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

  • Home
  • SEARCH
  • 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 4539856
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:00:19+00:00 2026-05-21T15:00:19+00:00

I’m trying to make my contact form submission process work equally well whether the

  • 0

I’m trying to make my contact form submission process work equally well whether the client has javascipt enabled or not.

If javascript is enabled, then validation will be handled client-side when an onsubmit event is triggered which calls my validateContactForm() function:

<form method="POST" action="email_processing.php" onsubmit="return validateContactForm();">

If false is returned, then the form isn’t submitted and the client is directed to correct what he has done wrong.

The form is submitted to the email_processing.php script on if true is returned by validateContactForm() or if javascript is disabled. The php script then revalidates the data and if everything is OK, it sends an email.

If I were relying on javascript, I could have made this process asynchronous and just have the php script return a message which would get handled by a callback function client-side. This would either be an error message or a success message.

But because I want to make this work for people with javascript disabled, I can’t do that.

If there’s an error, I need to return the contact form page with error messages displayed in the contact form and if it’s been a success I should maybe get rid of the contact form and just display a “thanks” message where the form used to be.

I’d be interested to know whether stackoverflow users would:

  1. Submit the form to a php script which would then redirect to a different php / html page.

  2. Have the validation / email sending functions at the top of the contact us php page itself and each time the contact us page is loaded we check to see if certains variables have been set and if so then we know that we need to validate and send the emails and display the correct format / message.

  3. If I should be thinking about this differently. This must be a very common situation to handle and I have done it many times in lttle applications for myself where I knew that I would have javascript enabled, but I need to do this for a client and I want to make sure that it’s done right.

Many thanks in advance

  • 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-21T15:00:20+00:00Added an answer on May 21, 2026 at 3:00 pm

    Here is what I do. first I use jQuery validate (thats just how I validate) and errors will show if there are any and won’t let the user continue without validation

    then then I send form submission using jQuery ajax when it hits the server I also do a double check with php this allows me double protection and errors are sent back

    if users don’t have javascript enabled when the form is submitted validation is done errors messages are displayed

    HTH

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
I am trying to loop through a bunch of documents I have to put
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.