# inputEx - DateSelectMonthField Usage

## Basic DateSelectMonthField creation

Use the following code to create a basic inputEx DateSelectMonthField.

var f = new inputEx.DateSelectMonthField({label: 'Birthday', parentEl: 'container1', showMsg: true, required:true}); f.updatedEvt.subscribe(function(e, params) { var val = params[0]; YAHOO.util.Dom.get('container1').appendChild(inputEx.cn('div', null, null, 'Updated with value= '+val)); }); var div = YAHOO.util.Dom.get('container1'); var button1 = inputEx.cn('button', null, null, "SetValue with today date"); div.appendChild(button1); YAHOO.util.Event.addListener(button1, "click" ,function() { f.setValue(new Date()); }); var button2 = inputEx.cn('button', null, null, "SetValue with empty string"); div.appendChild(button2); YAHOO.util.Event.addListener(button2, "click" ,function() { f.setValue(''); }); var button3 = inputEx.cn('button', null, null, "GetValue"); div.appendChild(button3); YAHOO.util.Event.addListener(button3, "click" ,function() { alert(f.getValue()); }); var button4 = inputEx.cn('button', null, null, "Clear"); div.appendChild(button4); YAHOO.util.Event.addListener(button4, "click" ,function() { f.clear(); });