The initial changes to the HtmlForm module and the new Validation module are complete.
HtmlForm module - Email CC and BCC
- Email SSL so it now works with GMail, Yahoo! etc.
- Email failure Exception logging
- EmailSent true|false flag on content item
- Added new optional render mode that uses MVC views (so you can tweak html output if necessary without recompilation)
- You can now setup html to appear before and after the form
- The new View render mode automatically picks up errors from the Validation module and redisplays the form
Validation module - Module plugs into a page with three entry urls.
/default/ClientValidationHeadTags/ - Renders jquery script tags required by client side validation
/default/ClientValidation - Renders custom javascript that performs client side validation
default/ServerValidation/ - Performs server side validation
- Validation rules are setup in a content folder you must call Validation.Set
- Validation options are
Is alphabetic
Is alphanumeric
Is data
Is digits
Is email
Is number
Is url
Minimum/maximum number
Minimum/maximum characters
Field must be equal to another field
Custom regular expression with custom message
- For server side validation all built in regular expressions and error messages are stored as text resources
- Can halt error checking after a specific error if desired
Note: I didn't want to store the validation rules as content items but I gave up trying to get the ExtJS form working so I couldn't use the module Admin button approach. I was going to use JQgrid instead but decided to just use content items instead.
Note: Server validation was going to be a plugin but there is no unhackable way of passing the validation set names into a plugin.
Note: You may suspect divitis if you look at the rendered form html but in my experience the approach I've used allows for the greatest amount of flexibility via css. Each customer wants it to look different and it's helpful to be able to tweak css rather than core module files to get what they want
Note: This is not ready for production use yet as it needs some more testing but it's at the alpha stage. Please help me break it!
Note: The Validation module is not tied to the HtmlForm module, essentially it adds a Dictionary<string, string> to the TempData collection that other modules can pick up. I've changed the HtmlForm module to pick the errors up but validation is not limited to this module. Anywhere where you are accepting input from the user (or in the request from any source into a Kooboo page) can use the Validation module.
I have created a version of the Small Business site package with a contact form that uses the Validation module.
Well I hope this is going to be useful to somebody, it's useful to me at least!
At the moment I don't have anywhere to host the files, they're 44MB in total and a bit large for email, can anyone help?
UPDATE : You can get the files here
http://cid-e2ac88168dffefb6.office.live.com/browse.aspx/.Public