Shape-shifting your forms experience in ASP.NET MVC
C# JavaScript HTML Other
Latest commit 1c4589d Jan 28, 2017 @robdmoore robdmoore committed on GitHub Merge pull request #155 from MRCollective/partial-fixes
Partial fixes
Permalink
Failed to load latest commit information.
ChameleonForms.AcceptanceTests Fixing a bug where a partial with a base class throws an exception Jan 28, 2017
ChameleonForms.Example Fixing a bug where a partial with a base class throws an exception Jan 28, 2017
ChameleonForms.Tests Removed the need to redundantly specify [Required, RequiredFlagsEnum] Jul 18, 2016
ChameleonForms Fixing a bug where a partial with a base class throws an exception Jan 28, 2017
docs Added documentation for supplying HTML to IFieldConfiguration Jan 28, 2017
.gitattributes Add a gitattributes file to disable line ending normalisation Nov 10, 2013
.gitignore Added support for flags enums Jul 16, 2016
AppStart.TwitterBootstrap.cs.pp Fixed compilation error with the app start file for the twitter boots… Nov 16, 2013
AppStart.cs.pp Fixing some problems with the app start file and fixing documentation… Jul 19, 2016
BREAKING_CHANGES.md Bumping major version in preparation for adding flags enum support Jul 16, 2016
CONTRIBUTING.md Update CONTRIBUTING.md May 18, 2014
ChameleonForms.TwitterBootstrap3.nuspec Bootstrap 3.3.5 NuGet package updated and changed version in the resp… Sep 8, 2015
ChameleonForms.nuspec Updating MVC dependency version to match the version used by the solu… Jan 5, 2015
ChameleonForms.sln Added flags enum documentation Jul 17, 2016
ChameleonForms.sln.DotSettings Added support for flags enums Jul 16, 2016
GitVersionConfig.yaml Bumping major version in preparation for adding flags enum support Jul 16, 2016
LICENSE Adding license / readme Sep 10, 2012
README.md Removing NuGet downloads badge since it no longer works Jun 29, 2016
html-helper-context.md Added shell for html helper context and different form models documen… Jan 18, 2016
logo.png new nuget logo and source .svg design Apr 15, 2014
logo.svg new nuget logo and source .svg design Apr 15, 2014
mkdocs.yml Added corrected mkdocs.yml for new flags enum documentation page Jul 19, 2016
web.config.transform Add Views/web.config transform to add ChameleonForms namespaces Jun 29, 2013

README.md

Chameleon Forms logo

ChameleonForms

Build status NuGet version Documentation status

This library will shape-shift your forms experience in ASP.NET MVC.

ChameleonForms takes away the pain and repetition of building forms with ASP.NET MVC by following a philosophy of:

  • Model-driven defaults (e.g. enum is drop-down, [DataType(DataType.Password)] is password textbox)
  • Extensible and flexible core - you can extend or completely change anything you want at any layer of ChameleonForms and you can drop out to plain HTML at any point in your form for those moments where pre-prepared field types and templates just don't cut it
  • Beautiful, terse, fluent APIs - it's a pleasure to read and write the code
  • DRY up your forms - your forms will be quicker to write and easier to maintain and you won't get stuck writing the same form boilerplate markup form after form after form
  • Consistent - consistency of the API and form structure within your forms and consistency across all forms in your site via templating
  • Declarative syntax - specify how the form is structured rather than the HTML output of the form; this, in combination with the aforementioned templating means that when it comes time to change the style of your site and/or HTML structure of your forms you can do so as painlessly as possible (think about a scenario where you rapidly prototype a new site using Twitter Bootstrap and you make it big and need to change to a custom design!)

ChameleonForms has built-in support for building forms using Twitter Bootstrap 3! Get rid of all the boilerplate code you have to write around every field and instead use code like below. Clone the repository and fire up the example project to see what we mean!

So what does a ChameleonForms form look like? Here is a (very) basic example:

@using (var f = Html.BeginChameleonForm()) {
    using (var s = f.BeginSection("Signup for an account")) {
        @s.FieldFor(m => m.FirstName)
        @s.FieldFor(m => m.LastName)
        @s.FieldFor(m => m.Mobile).Placeholder("04XX XXX XXX")
        @s.FieldFor(m => m.LicenseAgreement).InlineLabel("I agree to the terms and conditions")
    }
    using (var n = f.BeginNavigation()) {
        @n.Submit("Create")
    }
}

Find out more about why we created ChameleonForms and the advantages it gives you.

Installing ChameleonForms

ChameleonForms is available via NuGet.

Install-Package ChameleonForms

Contributors

Core Team

Other contributors

The core team would like to thank everyone that has contributed code to this project! Check out the contributors graph to see them :)

Documentation

Check out the Read the Docs site.

Continuous Integration

We have a continuous integration build that automatically builds and runs tests when we push/merge to master as well as all pull requests and generates the NuGet packages that we can publish to NuGet.org at the click of a button.

Contributing

If you would like to contribute to this project then feel free to communicate with us via Twitter @robdmoore / @mdaviesnet or alternatively send a pull request / issue to this GitHub project.

Roadmap

Feel free to check out our Trello board. It gives some idea as to the eventual goals we have for the project and the current backlog we are working against. Beware that it's pretty rough around the edges at the moment.

Thanks