Tags: forms

Validating file uploads in Sitecore WFFM

Our Sitecore installation was in dire need of a way to lock down file uploads on forms built with the Web Forms for Marketers (WFFM) module; out of the box, it doesn’t do any checking at all, which can lead to some risky situations. I tacked on a simple whitelist attribute to the UploadFile control, and our security engineer can breathe easy. Read More →

jQuery.imgradio Plugin v1.0 released

The default HTML radio buttons and check boxes aren’t the most aesthetically pleasing things in the world of web design. With this in mind, I have created a jQuery plugin that will replace those pesky <input /> elements with <span /> elements for your CSS styling pleasure. Under the hood, the original elements are still being used for storing the user’s selection(s), so there’s nothing extra for you to do when the form is submitted. Additionally, it can be configured to operate as a “rating” system—so that, for example, checking the 4th star in a 5-star list would swap the first 4 stars in the list to the “checked” state (visually speaking, at least… in the underlying radio buttons, only the 4th star would be selected). Read More →

Custom error messages with ValidationSummary in ASP.NET

Sometimes, there are problems encountered in a code-behind file that don’t warrant the extra work and mark-up that would otherwise be required to add CustomValidator controls to the page for displaying error messages to the user through your ValidationSummary. Wouldn’t it be nice if you could (somewhat) easily take care of it in your code-behind file alone, without adding additional clutter to your UserControl/Page/etc.? Well, you can! The following IValidator extension class can be added to a Page‘s Validators list with ease for displaying custom error messages. Read More →

Wipe all elements in a form with Javascript

Javascript has a nifty method associated with the form DOM object called reset(). Using this method will revert all values of the form’s associated input controls to the values they contained when the page was last sent to the user’s browser. That’s great… but if you want to revert the values to nothing, then some scripting is required: Read More →