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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:29:42+00:00 2026-06-11T13:29:42+00:00

I was wondering what actually the best way for a solid form validation is.

  • 0

I was wondering what actually the best way for a solid form validation is.

JavaScript does a quite good jon, but it is not a base for a solid validation, because it can be manipulated or even disabled.

If you check the data with PHP and re-populate a form when an error occurrs, there are several problems with a post form.

  • If the form is displayed without redirecting, then F5 will show a confirm box if the user wants to re-send the data, this is not really beautiful.
  • If the user gets redirected to the form again, the data must be submitted by GET or POST. With POST, there is again the F5-Problem as mentioned above. With GET, a problem exists when transferring values with a & inside (PHP guesses another parameter after the sign)
  • A third way would be to store the data in a database, e.g. SUBMITTRIALS or something like that. But then you’d actually have to clear the data after redirecting.

Another problem comes along with re-populating of the form itself: A code like this:

echo "<input type='text' value='".$val."' />";

is quite a problem if the variable $val contains a value containing apostrophes, this generates invalid HTML.

As you can see, there are quite much possibilities of failure in a form validation scenario. What would be the most reliable way to handle form-validation as described at top?

  • 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-11T13:29:43+00:00Added an answer on June 11, 2026 at 1:29 pm

    Server side languages are the only way to validate your form. You can store your form data in session or cookies for the same purpose. You can flush them once you are done with your validation. If you are having a problem with the quotes in your data then you can use PHP inbuilt function addslashes() and stripslashes() to avoid them.

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

Sidebar

Related Questions

Wondering what the best / good way of doing this would be in jQuery.
I was wondering about the best way to implement a Confirm Page upon form
I was wondering what is the best way to implement a renderer in JavaScript.
I was wondering what would be the best way to display informative form warning
Apologies if this is a silly question, but I'm just wondering the best way
I was wondering what is the best way to display a big PDF file
I'm wondering what would be the best way to group contacts by their company.
What is the best way to deal with input elements that are currently not
I'm wondering what's the best, the cleanest and the most simply way to work
I'm just wondering, as a hypothetical example, what would be the best way 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.