# inputEx - VectorField Usage

## Basic VectorField creation

Use the following code to create a basic inputEx VectorField.

var field = new inputEx.VectorField({parentEl: 'container1', value: [-10.4,13*2]}); var el = YAHOO.util.Dom.get('container1'); var button1 = inputEx.cn('button', null, null, "SetValue"); el.appendChild(button1); YAHOO.util.Event.addListener(button1, "click" ,function() { field.setValue([-42.42,12.603]); }); var logDiv = inputEx.cn('div', null, null, "Log :"); el.appendChild(logDiv); field.updatedEvt.subscribe(function(e,params) { var value = params[0]; logDiv.innerHTML += "Updated at "+(new Date())+" with value "+value; logDiv.appendChild(inputEx.cn('br')); });

## VectorField with separators

VectorField inherits CombineField, so you can change the separators :

new inputEx.VectorField({ parentEl: 'container2', value: [-10.4,13*2], separators: ["x:",", y:", null] });

## VectorField dimension

Set the dimension option :

new inputEx.VectorField({ parentEl: 'container3', value: [-1, 0, 1], dimension: 3, separators: ["x:",", y:", ", z: ", null] });