Photo Corners

A   S C R A P B O O K   O F   S O L U T I O N S   F O R   T H E   P H O T O G R A P H E R

Enhancing the enjoyment of taking pictures with news that matters, features that entertain and images that delight. Published frequently.

Site Tweak: Calendar Submissions Share This on LinkedIn   Share This on Google   Tweet This   Forward This

30 May 2017

Over the (long) weekend we added a new form to the site to submit events to our Calendar. You can find a link to it among the calendar links in the top left section of any calendar page.

We hear from publicists, of course, but we thought others might want an easy way to notify us about events.

And it is easy. It asks for some contact information in case we have questions. And then it gets to the particulars with hints about formatting.

The form also validates each entry. Which just means it checks to see if the entry is properly formatted.

Some people seem to think the data entry person should be flogged to prevent common mistakes.

We never thought of validation as a controversial concept (because, you know, "garbage in, garbage out") until we started making forms for other people. There are people who don't think it's necessary to check that a date is actually entered as a date, for example.

Some people seem to think the data entry person should be flogged to prevent common mistakes. But flogging is unpleasant for everyone and takes a lot more time than data validation.

The big problem with unvalidated data is that it invalidates any conclusions you might reach from a search. You may have sorted your list by date, say, and think you've seen all the May entries. But you won't if the people entering the dates don't consistently (always) use the same date format.

We use two methods of validation. One is performed by asynchronous JavaScript, an old standby that should work fine on older browsers with JavaScript enabled. The other is performed by HTML5, the new kid on the block, which makes validation very simple to implement. Start there if you're new to this.

Once the data has been entered in the correct format, it's evaluated once more by the PHP code to make sure nothing slipped by unnoticed. If so, the form data is displayed so you can see what the problem is.

Otherwise it's emailed to us already formatted in JSON so we can look it over and slip it into the Calendar.

It's efficient enough that we might start using it ourselves to make Calendar entries. Give it a try when you run across a museum or gallery show with a focus on photography.

BackBack to Photo Corners