Search

A new extension, "Lazy Input Correction" is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

Lazy Input Correction

Checks input fields for poor capitalization. User input that is all lowercase or all uppercase will be properly capitalized with the first letter capital. Extra whitespace around input will also be removed.

What's being checked

If the first letter of a word in the input is lowercase, then the input will be filtered. If the first letter of a word is the capital and the last letter of that word is capital, then the input will be filtered.

Examples

  • mcdonald to Mcdonald
  • MCDONALD to Mcdonald
  • McDonald to McDonald

Wow, I was just looking into a solution to this yesterday..

Thanks!

Let me know if you have problems or suggestions for improvement. Thinking about an exceptions list.

Hi Lewis

I knew this would come in handy soon and a client just asked me for this very functionality.

Installing it however seems to break my forms. The form would usually create an entry and send an email using ETM but with this extension enabled neither of those things happen. When I disable the extension it all works again.

Any ideas?

Thanks. Stuart

What is the event's XML result?

I can't check this as there is no code output. Its just a white screen.

I can't check this as there is no code output. Its just a white screen.

Turn on display php errors or check log for error mesage.

Sure. I get this error:

Fatal error: Class 'Section' not found in /srv/www/futurelandforces.com/publichtml/extensions/lazyinput_correction/extension.driver.php on line 33

Lazy Input Correction updated to version 1.01 on 6th of January 2012

Thanks stuartgpalmer. Let me know if the latest update doesn't solve the problem.

Thanks Mark. That has fixed it.

I know that a feature request is no way to treat someone who has just helped you out, but...

It would be great to have some way to use this on a per-field basis with options for:

  • Upper case (for UK post codes for example - TQ9 6QY)
  • Lower case for emails
  • No change for messages

I have no idea how this would work, but its just an idea.

Thanks again.

I know that a feature request is no way to treat someone who has just helped you out, but...

Not always true. Your requests show interest and that usually makes an extension developer happy (well, for me it does).

All uppercase and all lowercase is a great idea. That would definitely need the extension implemented on a per field basis. I considered going this route originally but for my needs this simple approach worked. I totally get though that for this extension to be more versatile it would be best to implement a checkbox on fields, or select box with different options. I'll start looking into this approach.

As it stands, the extension only affects text inputs via an event. All other fields are ignored and the backend is ignored.

Thanks for the ideas!

I have no idea how this would work, but its just an idea.

I have thought about this further and I know exactly how I will implement it. I'll try to work on it and get it done next weekend.

Great. I can't wait to see it :-)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details