Recently I had to build a custom form for VSU’s implementation of R25 by CollegeNet. The form was designed to allow individuals to schedule an event at VSU using our facilities and equipment. The form is a multi-part form that branches off at the third page based on prior answers.
One of the hurdles in the form creation was the necessity of validating the form input on a page before proceeding to the next part of the form. While this fairly routine process can be accomplished by using a self-referencing form and validating the contents of the $_POST superglobal, the number of form elements made it somewhat cumbersome.
Enter the PHP Form Validation Script. While searching for some ways to make the validation more painless to code, I ran across a nifty PHP script at the HTML Form Guide website. It is a object-oriented PHP script that make it much easier to do the validation on html form elements. There are quite a few pre-defined validation descriptors, plus a method that allows for overriding the DoValidate function to create your own custom descriptor.
There is one thing that I would like the script to handle natively:
- use of a “pretty” or “friendly” name in the validation error messages, currently it displays the element name
There is also an undocumented validation descriptor in the script. The pre-defined selone is used for a select/option element. According to the code the default error message is “Please select an option for %s” and it check to ensure that the value for the element is set and that the value is less than or equal to zero. If either of those check fail then the error message is displayed.
Last week my friend Lindsay and I were making the rounds of the various thrift stores and used furniture stores in Valdosta. It is quite interesting to see what people get rid of and to think of ways to use some of it.
At one of the thrift shops we found three VSU glasses. One of them is a glass that was given out to the VSU student employees at the Student Awards banquet last year. Another one was from the Faculty and Staff Campaign from 2002. There were tons of promo glassware from all kinds of companies, restaurants and schools. I wonder just how much of that kind of stuff is bought and given out only to end up in some landfill or thrift shop.