inputEx - DateSelectMonthField Usage

Basic DateSelectMonthField creation

Use the following code to create a basic inputEx DateSelectMonthField.

 
 
1var f = new inputEx.DateSelectMonthField({label: 'Birthday', parentEl: 'container1', showMsg: true, required:true}); 
2 
3f.updatedEvt.subscribe(function(e, params) { 
4    var val = params[0]; 
5    YAHOO.util.Dom.get('container1').appendChild(inputEx.cn('div'nullnull'Updated with value= '+val)); 
6}); 
7 
8var div = YAHOO.util.Dom.get('container1'); 
9 
10var button1 = inputEx.cn('button'nullnull"SetValue with today date"); 
11div.appendChild(button1); 
12YAHOO.util.Event.addListener(button1, "click" ,function() {  
13    f.setValue(new Date());  
14}); 
15var button2 = inputEx.cn('button'nullnull"SetValue with empty string"); 
16div.appendChild(button2); 
17YAHOO.util.Event.addListener(button2, "click" ,function() {  
18    f.setValue('');  
19}); 
20 
21var button3 = inputEx.cn('button'nullnull"GetValue"); 
22div.appendChild(button3); 
23YAHOO.util.Event.addListener(button3, "click" ,function() {  
24    alert(f.getValue()); 
25}); 
26 
27var button4 = inputEx.cn('button'nullnull"Clear"); 
28div.appendChild(button4); 
29YAHOO.util.Event.addListener(button4, "click" ,function() {  
30    f.clear(); 
31}); 
view plain | print | ?