Download this project in
either
zip or
tar format.
You can also clone this project from
git://github.com/sbfaulkner/jquery.token-field
<input type='text' id='input-test' name='emails'
value='one@first.net,two@second.net,three@third.net,four@fourth.net,five@fifth.net'/>
<script>
$('#input-test').tokenField();
</script>
<textarea id='textarea-test' name='emails'>
one@first.net,two@second.net,three@third.net,four@fourth.net,five@fifth.net
</textarea>
<script>
$('#textarea-test').tokenField();
</script>
<input type='text' id='max-test' name='emails'
value='one@first.net,two@second.net,three@third.net,four@fourth.net,five@fifth.net'/>
<script>
$('#max-test').tokenField({
max:3, tooMany:function() {alert('you already entered 3 addresses'); $(this).val('');}
});
</script>
<input type='text' id='phone-test' name='numbers' value='555-1212,(123) 555-1212'/>
<script>
$('#phone-test').tokenField({regex:/^(?:\([0-9]{3}\) ?)?[0-9]{3}\-[0-9]{4}$/});
</script>
<input type='text' id='word-test' name='words' value='abc123,hello,foo-bar,no spaces,underscore_ok'/>
<script>
$('#word-test').tokenField({regex:/^[a-z][\w\-]+$/i});
</script>