Condor.js version 1.5

Demo

Type in the input to the right to see Condor in action!

Using Condor.js:

Download Condor.js View on GitHub
DEPENDENCIES
HTML

Place this div where you want to use Condor: (it should be within a form)

<div id="condor">
 <!--This is where the condor field will show up.-->
</div>


At the end of your body, place this snippet of code:

<script type="text/javascript">
 $(document).ready(function() {
  $("#condor").condor();
 });
</script>

You can pass Condor options in a JSON object. Parameters are documented below

OPTIONS
Setting Type Signature Default Description
minInputs int 1 the min number of inputs we'll resize to
maxInputs int 10 the max number of inputs we'll resize to
namePrefix string 'inputs' what gets prepended to the name of each Condor input
uniqueNames boolean true whether we'll append unique ids to Condor input namePrefixes
inactiveHint string 'add input' placeholder text for inactive Condor input
inactiveInputClass string 'inverted'

class which gets applied and removed to the input wrapper of inactive Condor inputs

this is a quirky way to make inactive inputs borderless w/o introducing css. If you're using your own styles, target condor-add, a class applied to inactive inputs at the field wrapper level.

activeHint string none placeholder text for activated Condor inputs
activeIcon string 'linkify' the semantic-ui icon for activated Condor inputs
addCallback function () function () {} a zero-parameter function which gets called every time an input is added
activateCallback function () function () {} a zero-parameter function which gets called every time an input is activated
inputType string 'text'

the input type of Condor inputs.

don't try anything crazy like radio buttons!

prepopulate string [] none

an array of strings to prepopulate Condor with.

useful for loading saved data

© 2014 Chen Ye | MIT License | Bugs? File an issue here!

Links