Skip to content
This repository has been archived by the owner on Dec 24, 2017. It is now read-only.

monooso/freeform_values.ee_addon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An Important Note About Support

Freeform Values (in common with all of my ExpressionEngine add-ons) is no longer officially supported.

This README contains basic usage instructions. Feel free to fork the repo if you'd like to make some changes or improvements (it's distributed under a liberal open source license).

Hopefully this will be everything you need to use this add-on in your projects, but if not please don't email me asking for support; I don't even have ExpressionEngine installed locally any more.

Overview

By default, if you want Freeform to preserve your field values after an error, you must use the {freeform:field:FIELD_NAME} tag, which outputs the complete HTML tag for your form field.

This is all well and good, until you want to add something other than a text field or textarea to your form. At that point, you either forego the simple ambition of preserving the previously-submitted form values, or you shell out $99.95 for Freeform Pro (and excellent product in many ways, but not if all you want is a checkbox, for example).

This is where Freeform Values comes in. It hooks into the standard Freeform hooks, and makes it possible to do this:

<input name="contact_email" type="email" value="{freeform:value:contact_email}">

If the form has been submitted (and failed validation), the {freeform:value:FIELD_NAME} template tag is set to the previously-submitted value. Otherwise, it's set to an empty string.

You can even use the tag in conditionals, like this:

<input name="newsletter" type="checkbox" value="Y"
  {if '{freeform:value:newsletter}' == 'Y'}checked{/if}>

Caveats and whatnot

I haven't tested this add-on with Freeform Pro (that was the whole point of writing it, after all).

In fact, I haven't tested it on anything other than my own site, which at time of writing is running PHP 5.3.10 and EE 2.5.5. It should work fine on PHP 5.3.x and above, but there are no guarantees.

This is also offered without any support whatsoever. Feel free to fork if you need it to dance to your tune.

About

Preserve Freeform field values after a failed form submission.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages