Use the following code to create a basic inputEx UpperCaseField.
1 | var field = new inputEx.UpperCaseField({parentEl: 'container1', value: 'i was lowercase'}); |
2 | |
3 | var el = YAHOO.util.Dom.get('container1'); |
4 | |
5 | var button1 = inputEx.cn('button', null, null, "SetValue with 'InputEx'"); |
6 | var val = 'InputEx'; |
7 | el.appendChild(button1); |
8 | YAHOO.util.Event.addListener(button1, "click" ,function() { |
9 | field.setValue(val); |
10 | val = (val == 'InputEx') ? '' : 'InputEx'; |
11 | button1.innerHTML = "SetValue with '"+val+"'"; |
12 | }); |
13 | |
14 | var logDiv = inputEx.cn('div', null, null, "Log :"); |
15 | el.appendChild(logDiv); |
16 | field.updatedEvt.subscribe(function(e,params) { |
17 | var value = params[0]; |
18 | logDiv.innerHTML += "Updated at "+(new Date())+" with value "+value; |
19 | logDiv.appendChild(inputEx.cn('br')); |
20 | }); |
view plain | print | ? |