Archives / 2007 / September
Perfect validation?
Doing validation well and being able to get it done quickly is a recurring problem in any web project. When I first started using ASP.NET I thought the built in validation controls would be the answer.
They were really easy to add to a page, but they didn't do everything I wanted them to and I found some of the code they produced a bit strange.
I set about making my own controls that would be just as easy to add to a page, but do everything I wanted them to.
My main requirements were:
- Easy to reuse and add to new forms
- Validate on server and client
- Client side validation to use ajax
- Visual feedback to user as form is being filled in
- Easy to unit test
I've created a number of validation controls that are very easy to add to a page. You just add the controls, tell them the validation rules to use and everything else is done for you. It only takes a few minutes and this used to take hours.
The controls will always validate on the server, but if they will also validate with JavaScript (if available) and only submit to the server when the validation passes.
The visual feedback was difficult to get right and I had to test out several options on willing volunteers till I found what worked best.
I've centralised all the validation rules I use and written unit tests for them. This means that I'm much more confident that the validation validates what it is supposed to.
You can see them in action on my contact page and the register page of this blog.
However, I'm still not sure they're perfect and I'm going to keep on refining them. The great thing about creating controls to do this, is that they'll continue to get better, and all my projects past and present will benefit from it.
Be in the Simpsons
This is my favourite recent discovery. A fantastic site for the new Simpsons Movie. The site is so good that I may go and see the film again.
The site is full of brilliant ideas and lots of cool games to play.
The part that has captured my imagination most is the create your own Simpsons character bit. Once you've made one, there are lots of ways to share it with your friends. What a brilliant piece of personalised viral marketting.
Here is my attempt, although I couldn't quite get the hair right.
Search my blog
Adding a search engine to a site used to be a difficult business. It could be expensive, difficult and quite often not very good.
A while ago Google launched Google Co-Op. It lets you create your own site search engine using all the power of the main Google search engine.
It's perfect for a small blog like this, so I decided to try it out to see what the pros and conns were.
Here they are:
Pros
- Easy to set up
- Free
- Good results
- Familiar to everyone
- You can link the advertising to your own Adsence Account
- URL exclude filters
- Simple stats on number of searches and popular search queries
Cons
- You need to show adverts unless you are a charity or non-profit organisation
- Can be slow to index new pages
- Completely dependent on JavaScript
- Search result code is not W3C compliant
For me the pros outweigh the cons, so I'm going to keep the search page for this blog. However, if I was a larger organisation having to show ads could be a show stopper.
OpenCoffee {Quattro}
Yesterday I went to my second OpenCoffee event. I've not done a lot since the last one, but this is mainly because I've been away to the exceedingly hot Zakynthos.
This is the fourth OpenCoffee they've had. I'm wondering how long they'll be able to keep up with the {quattro} naming convention. I'd be lost by the time we get to double figures.
Anyway, I had a lot of fun and met a lot of interesting and great people. I met less people this time, but talked to them more. It was great to find people with similar interests and find out what they were up to.
I've started a little scrap book of business cards to help me remember who everyone I met was. I also handed out more of my origami business cards. These are proving to be very popular, although very tricky to make.
You can find out more about OpenCofee here: