inputEx - PairField Usage

The PairField is now deprecated. It has been replaced by the CombineField, which is much more powerful.

Basic PairField creation

Use the following code to create a basic inputEx PairField.

new inputEx.PairField({parentEl: 'container1', showMsg: true});

PairField composition

Composition

var field = new YAHOO.inputEx.PairField({ label: 'Your favorite color', parentEl: 'container2', showMsg: true, leftFieldOptions: {type: 'string', inputParams: { description: 'Favorite color', value: 'blue'} }, rightFieldOptions: { type: 'text', inputParams: { description: 'Why is it your favorite color ?', value: 'looks like the sky' } } }); var button = YAHOO.inputEx.cn('button', null, null, "getValue"); YAHOO.util.Event.addListener(button, 'click', function() { alert( YAHOO.lang.JSON.stringify(field.getValue()) ); }); YAHOO.util.Dom.get('container2').appendChild(button);