This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
LICENSE.txt | Wed Oct 07 10:33:56 -0700 2009 | |
| |
README.textile | Fri Oct 09 07:31:01 -0700 2009 | |
| |
demo.css | Wed Oct 07 10:12:09 -0700 2009 | |
| |
demo.html | Fri Oct 09 07:32:39 -0700 2009 | |
| |
demo.js | Fri Oct 09 07:32:39 -0700 2009 | |
| |
lib/ | Mon Sep 28 08:16:58 -0700 2009 | |
| |
src/ | Fri Oct 09 11:50:39 -0700 2009 |
README.textile
jquery.populate
Manual testing your web app is a pain when you have lots of forms which need to be filled in. Not anymore!
Usage
$('input').populate();
That was easy! Inputs with a name containing ‘first_name’ will be filled in with a random first name, etc.
What if I want to add a new field type?
$.populate.registerValues({
favoriteColor: ['red', 'green', 'blue']
});
Now favorite_color inputs will be filled in with a random color choice from [‘red’, ‘green’, ‘blue’]
I want to write a function to generate my field value
I won’t stop you!
$.populate.registerValues({
favoriteColor: function() {
return 'red';
}
});
What if my new field depends on the value of another field?
I want the username to be the first name plus a number, or I want
the password confirmation to be equal to the password, for example.
(Both of these examples are already in the plugin)
$.populate.registerValues({
username: $.populate.dependency('firstName', function(firstname) {
return firstname + Math.randomInt(100);
}),
passwordConfirmation: $.populate.is('password')
});
Easy-peasy.
Check demo.html/css/js for more examples.







