Coder Social home page Coder Social logo

oform's People

Contributors

kylerush avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

optimizely

oform's Issues

Support for custom error messages

Needs to support custom error messages. For example, consider a password field. The password field may have certain requirements. If no value is entered into the password field "Required" may be a good error message. But if a value is entered and the value does not conform to the requirements, "Not a valid password" might be a better error message.

validate non-required fields

there should be an option to validate fields that don't have a required option. if the field does not have a blank string then the value should be validated even if it doesn't have the required attribute.

this should be done by adding a data attribute to the input like so:

<input type="email" name="email" data-validate> 

add validaton option

need to add an option that allows you so specify when the validation option executes.

should look like this:

new Oform({
  selector: '#form',
  validateon: 'keyup'
});

options should be:

  • 'keyup'
  • 'focusin'
  • 'focusout'

Create processing state

The production site changes the background of inputs to light grey while processing. I tried implementing this with the before and load events but it gets complicated because before will run even if there is a validation error, and if there is a validation error load will not fire.

Email Validation

It doesn't look like the email validation is working properly

screen shot 2014-09-18 at 3 56 15 pm

add support for no method attribute on form tag

if no method attribute is on the form tag selector Oform should not do a POST request and instead just run a success function if the form validated correctly. the success function should still run though if there is a method attribute after the response is received.

body.error class

in the rewrite this feature got lost. upon each form submit oform should adjust the body class. if there are validation errors, oform should add an error class to the <body> tag. if there are no errors it should remove the class.

should be used like this:

new Oform({
  selector: '#form',
  bodyErrorClass: 'error'
});

default:

new Oform({
  selector: '#form',
  bodyErrorClass: 'oform-error'
});

to disable this feature:

new Oform({
  selector: '#form',
  bodyErrorClass: null
});

validation function does not actually work

this line does not actually execute the function:

if( instance.options.validate[type] ){

it just checks to see if the function exists. it needs to actually execute the function and pass an argument.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.