Thursday, May 9th, 2013
A drop down list is one of the easiest of input fields to validate in JavaScript since you already know all the values that the field can have and presumably all or all but one of them are valid. Where you need to require that visitors make a selection is the only time you would [...]
Posted in Golden Oldie | Permalink | Comments Off
Wednesday, December 19th, 2012
If only some of your form fields are actually getting to the server then there are a number of things that might be wrong. In this article we consider many of the possible causes and how to fix them. Problems with Forms
Posted in Golden Oldie | Permalink | Comments Off
Tuesday, December 11th, 2012
HTML 5 currently shares a doctype with prior versions of HTML such as HTML 2. This short version of the doctype simply says that the page is written in HTML without specifying which version. Since we don’t want any antiquated HTML 3.2 tags in our page when we are using HTML 5 we need an [...]
Posted in What's New | Permalink | Comments Off
Saturday, November 17th, 2012
This article is the first part of the introduction to my series on PHP Security. The introductory articles cover some of the basic concepts of how to apply security with the later articles covering more specific examples of how to apply security. This first article introduces data validation. Everything is Tainted Until Proved Otherwise
Posted in Golden Oldie | Permalink | Comments Off
Wednesday, October 24th, 2012
Validating a date in JavaScript is straightforward as long as you get the day, month and year separately in the first place. This function not only performs the validation, it loads the date into a date object for you as well.
Posted in What's New | Permalink | Comments Off
Wednesday, October 10th, 2012
Sometimes the solution to a problem is extremely simple but not very obvious until you know what it is. One such simple solution relates to not losing the values already entered into a form when you want JavaScript to report validation errors. Keeping Entered Values when Reporting an Error p.s. why do so many people [...]
Posted in Golden Oldie | Permalink | Comments Off
Tuesday, September 11th, 2012
In this article we look at the circumstances under which it makes sense to apply JavaScript validation to individual form fields and where it makes sense to apply the same validation immediately before submitting the form. Validations that involve calls to the server (called ‘ajax’) are a special case. Form Submission and Ajax
Posted in What's New | Permalink | Comments Off
Tuesday, August 7th, 2012
The only way to really know if an email address exists is to send an email to the address and then get a response back. Validating email addresses even to determine if a given address is allowed to exist is quite complex. Most scripts that people use to validate email addresses actually reject a large [...]
Posted in What's New | Permalink | Comments Off
Tuesday, May 29th, 2012
Leaving out the validation makes it easier to demonstrate the part of the code that is being taught without it adversely affecting the way the code works provided that only valid values are input. Since the person learning to code can be relied on to enter valid values this makes teaching the code constructs easier [...]
Posted in What's New | Permalink | 1 Comment »
Tuesday, May 15th, 2012
Just about all of the forum questions asked by PH beginners have no input processing in their script whatsoever. With over half the code that they should have in the script missing, that the part they do have doesn’t quite work properly is the least of their problems. One way of making sure all of [...]
Posted in What's New | Permalink | Comments Off
Saturday, March 17th, 2012
Why worry about validating your HTML? Well there are a number of reasons why it is best to avoid using HTML that doesn’t validate. Invalid HTML
Posted in Golden Oldie | Permalink | Comments Off
Wednesday, October 26th, 2011
I first wrote this page back in 2001 and for most of the time since then it has been the number one result in Google for that phrase. Of course JavaScript has changed a lot since then and so I have written other versions of the page showing the alternative ways to do it (which [...]
Posted in Golden Oldie, What's New | Permalink | Comments Off