Archives May 7, 2007

Monday 7th May 2007 - 20:23:20

Chip

Lots of code on the main form I've been working on in our Sugar project. Finally All the data comes out where it needs to be, now I need to make it save it back in (if its changed). I've done a lot of javascript validation and such, learned a lot. The rest of the forms will be much easier. I love YAHOO YUI though, it would have been much harder to do without it. The events and popups in particular, this is a big-mother of a form for loan pre-aproval. They want to know incomes to underpants colour pretty much, so it needs lots of keyup and lostfocus events for validation.

There are mostly two events per numeric field, blur and keyup. I'm primarilly using keyup for addition and updating total fields, although it validates as well. Blur is pretty much zeroing empty fields so everthing looks nice. YAHOO tooltips. Bloody excellent. I'll definately be using them again in other projects. The really cool bit is you can put full CSS+HTML into a nice looking popup on a mouseover that times out like a real tooltip. This is without crappy CSS based rubbish and DIV hiding and showing that takes about 20 lines of HTML and CSS and JAVASCRIPT. These are so simple, the customer loves them! Simpler code, plus you can stick DHTML in them if you want to. I'm using hard-coded content at the moment for them. 1 line, define the content, 2nd line, define the popup with the ID of the element you want to mouse-over. Beautiful!