Wednesday, January 29, 2014

A Multi-step web form with AngularJS and CSS only (no jQuery), Form Validation with tool-tips, Animations & More.

I am new to AngularJS.  Last month I had to write some complex web Form for our website. Naturally, I used jQueryjQuery Validation Plugin + jQuery UI. The script with jQuery  was very unorganized and not maintainable. I started looking for a better way.  I read about AngularJS and found that it fits my needs. I wanted to publish the source code of what I have already accomplished, because as a beginner in the AngularJS world, not all of the solutions are easy to find.

What do we have here?

  1. Multi-step form with CSS transition animations.
  2. AngularJS Script without any jQuery.
  3. Native AngularJS form validation (e-mail validation, required field validation,password pattern).
  4. Custom Tooltip-like error display (CSS only).
  5. The form is styled with Bootstrap CSS.
  6. A custom AngularJS directive "passwordMatch", verifying that the "Password" field equals to  "Confirm Password" field.   (From Roger Alsing Weblog)
  7. The Security Questions are generated from a  JSONP Ajax call  (That works on a old IE browser and even without the "Access-Control-Allow-Origin" header!).


Source Code + Live Example


 CodePen
 GitHub

Have fun!

2 comments:

  1. Hey, I'm looking for a Front End developer to join the R&D team in SupersonicAds.
    We relay heavily on Angular.js and its a plesure :)
    - contact me: Amir at supersonicads

    ReplyDelete

Copyright © 2014 Ronny Hacohen
This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.