Well, since v2 is taking longer than planned, I'm releasing build 138. There's a few fixes that I've made and I've added a couple of useful properties. The highlight of this build is that you can now toggle off validation for a form by setting the qForm object's _skipValidation property to true, the validation rules will be ignored. This will be useful for those users looking for a way to "Save & Exit" from a form, without applying the validation rules. Here's a list of what's changed:
[-] Fixed a bug in the is/validateFormat() method which affected masks which contained 3 or fewer characters. [-] Fixed bug in Opera v7.x where single checkbox elements where not working w/the setValue()/getValue() methods. I had fixed this in the v2 builds already. [-] Fixed bug w/validateLengthGT and LT if the value was equal to the specified argument than no error was thrown (and it should be). [+] Added qFormAPI.styleAttribute which allows you to specify a single property to apply a style change to. This defaults to "backgroundColor". This provides a quick CSS hack until v2 is released. If you change the qFormAPI.errorColor to a valid CSS property value you can do more than change the color. For example: qFormAPI.styleAttribute = "border"; qFormAPI.errorColor = "1px dotted red"; NOTE: This is experimental at best, you need test in different browser. [+] Added obj._skipValidation property which allows you to toggle validation off/on for an entire form. Setting the property to true will cause the validation routines to be skipped for that form object. [+] Added the validation_addon.js library. At this point, this contains one additional validation method called validateAtLeastOne(), which you can use to confirm that at least one field out of a list of fields contain a value.
As always, you can download the latest version of qForms from http://www.pengoworks.com/qforms/download/.
Ok, I thought I'd compile a little list of Firefox extensions that are useful for any web developer (and a few that are good for any user of Firefox.) For those of you who read my blog, you'll know that I've switched to Firefox as my primary browser—it's just fantastic. Anyway, here's a list of the extensions you shouldn't be without.
I tend to forget just how many commands are built-in to T-SQL. So often the stuff I do in the database is so basic, that I forget that there are often many different ways to approach the same problem and I often just forget that certain functions even exist.
I was reading through my SQL Server 2000 Unleashed book the other night, and came across the COALESCE() function—one of those functions I had forgetten about. In a nutshell, you can provide the function an unlimited number of arguments and the first argument which isn't equal to null will be the value return from the function. The funny thing is, I had been trying to debate on the best method to re-write a particular stored procedure and the COALESCE() ended up being a very elegant solution.
The problem I was faced with, is I wanted to write a single stored procedure that I could use to update any single column or combination of columns based upon the primary key. In the past, I've always just written out a nasty looking string and then passed that to the execute command or the sp_executesql stored procedure that's included in SQL Server.
Micah Dubinko has posted a response to the Ian Hickson's comments about the future of XForms. Micah says Ian "swings and misses", but I think that's more accurate of Micah's post than of Ians.
Dubinko has done a ton of great work and I admire what he's put together with XForms, but I just don't think his response does anything to discredit what Ian had to say. Until there's a large outcry from developers to support XForms, there's going to be no effort made to integrate within the browsers. I know there's a few diehard XForms fan, but we're a long ways away from the mass of developers being ready to use and understand XForms.
One point I really disagree with Micah on is the trusting of XForms to do server-side validation. There's no way using HTTP that I place any trust in an response received from the client. It's way to easy for someone to arbitrarily change the rules of the XForm when they submit the document back to the client. You really still need to do something on the server end of things to verify the "signature" of the XForms. After verifying the signature of the document, you'd still need to re-validate the data in the form. So, it's not as simple as he stated in his response.
This piece of news seems to have gone largely unnoticed by the community—so thanks to Colin Moock for pointing it out. ECMA has announced, that a new extension for the 4th generation of ECMAScript has been agreed upon. The new standard, E4X (or ECMAScript for XML) will standardarized, vendor-neutral programming syntax for adding native XML support to the ECMAScript language.
I was pretty excited when I first read this news, but after reading the article by John Schneider, I'm not so sure I'm found of the idea. I think I like the idea of a generic DOM model much better. The new syntax looks clunky to me and doesn't feel like a natural extension to ECMAScript (which what JavaScript has become.) John claims the code is "simpler, more compact, and more familiar to the average programmer..." I don't know that I agree with that. It looks like a pretty strange, foreign syntax to me. However, that example may not be good example. I look forward to seeing more on this. Lord know I'd love the browsers to come up w/a standardized XML DOM API.
Jason, over at Terminal Fusion, has blogged some comments about qForms. Always keeping an eye out for what people have to say about qForms—good or bad.
Ironically enough, I was on Dean Edwards' site a couple of nights ago and completely missed this. Dean Edwards' has put together a neat little behavior for IE which attempt to correct IE's support for CSS2, called IE7.
The idea behind this behavior is that you can use IE's ability to dynamically alter a stylesheet in order to correctly display CSS statement currently not support by IE5+. It does this by changing the CSS statements to styles that IE does support and that will mimic the correct CSS behavior as per the W3C spec. This behavior will also attempt to correct a few other issues IE has with compliancy—such as PNG transparency. Make sure to check out his list of compatibility fixes.
It's a pretty cool idea that could help developers start writing W3C compliant code. I've been developing websites professionally since 1995 and always trying to hack code in order for it display correctly has gotten very old. Anyway, go applaud Dean and his affords.
I was reading the XForms Mailing List this morning and came across a message which pointed to a post on gmane.comp.mozilla.devel.layout newsgroup about the future of XForms and Mozilla.
The author of the newsgroup post, Ian Hickson, also works full time for Opera Software—the maker of the Opera Browser—so I'd imagine Opera shares a similiar path as Mozilla. Here's my favorite quote from the post:
> so I just don't buy that its so complex that that our weary little
> brains will melt.Many authors I have spoken to disagree. The entire concept that your form controls aren't what gets submitted is very difficult for many people to understand. You have to realise that for many people, even the concept of CSS is hard to understand. People ask "how do I make this text blue", not "how do I make all my headers blue". The former is answered by the WYSIWYG mentality, stick in a <font>. The latter is answered by the semantic/style divide mentality, mark up the text as being a header, then add a rule to your stylesheet that maps headers to a colour.
In XForms the problem is even worse -- "how do I disable this control?" has the answer "you tell your data model that the relevant subtree is no longer relevant, then you bind your subtree to the control". People's brains dont melt -- they just go elsewhere.
Sean Corfield posted a cool tip on his blog yesterday on how to find out the underlying Java type of any ColdFusion variable. The article covers the fact that the "form" scope is not really struct, even though it acts like one. To find out the Java type of a ColdFusion variable, simply invoke the following methods on the variable: ".getClass().getName()". For example, to see that the ColdFusion "form" scope is indeed not a structure, try the following code:
Thanks to Sean for the great tip!
Ok, two blogs in a row—both courtesy of Rob. I was browsing through his archieves and found an entry about a cool extension for Firefox/Mozilla that does all sorts of really cool stuff for Web Developers. I can think of a number of times when a tool like this would have been useful in the past. Unfortunately, there's been an IE tool that's similiar that I never knew about. Geez! Anyway, check out the following tools that should be useful to any web developer.
Rob Brooks-Bilson blogged about an issue he's seen when using qForms with Mach-II. Seems that Mach-II stores all it's generated content in a variable called "Request.content." However, when running in Debug mode, the Request.content code gets outputted a second time, thus causing errors in your template because of the duplicate output.
I'll try playing around w/the code to see if I can stop qForms from throwing a fit, but this is really more of a problem with the debug templates. I normally edit CF's debug templates to make sure that output is wrap in the htmlCodeFortmat() function—that way I see actual value of the string—and not what it's rendering. One of the comments on Rob's blog also mentions this point.
On a mailing list recently, someone asked where they could find their serial number for an installed copy of CF4. Fortunately I had a copy of CF4.01 where I could look up in the registry where the serial information is stored. If you're updating an old install of CF and need the original serial number for the software, try checking the server's registry branch of:
HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\Registration
I've posted an update to the Mask JavaScript API over at PengoWorks.com. The new update fixes some bugs in Mozilla and also makes sure that the keyboard events are added to the existing event handlers (and they don't replace already defined key events.)
CFML on the XBox? Charlie Arehart blogged about a customer's note on the BlueDragon Mailing List who claims to have had success installing BlueDragon on his XBox—which is running the Debian build of Linux. Talk about an inexpensive server. :)
Ok, I finally got the qForms v2.0 Preview uploaded. I had some problems with Camtasia on my laptop—the recording was fine, but I couldn't export to SWF—I finally got things working by installing Camtasia on one of my desktops. Here's a quick rundown on some of the things you'll see in the preview: