# inputEx - EmailField Usage

## Basic EmailField creation

Use the following code to create a basic inputEx EmailField.

var field = new inputEx.EmailField({parentEl: 'container1', showMsg: true }); var logDiv = inputEx.cn('div', null, null, "Log :"); YAHOO.util.Dom.get('container1').appendChild(logDiv); field.updatedEvt.subscribe(function(e,params) { var val = params[0]; logDiv.innerHTML += "Updated at "+(new Date())+" with value: "+val; logDiv.appendChild(inputEx.cn('br')); });

## Basic EmailField creation (with MX correction)

Use the following code to create a basic inputEx EmailField (with MX correction)

var field = new inputEx.EmailField({parentEl: 'container2', showMsg:true, fixdomain:true, description:"Try abc@gmail.co, abc@yaoo.fr..." }); var logDiv = inputEx.cn('div', null, null, "Log :"); YAHOO.util.Dom.get('container2').appendChild(logDiv); field.updatedEvt.subscribe(function(e,params) { var val = params[0]; logDiv.innerHTML += "Updated at "+(new Date())+" with value: "+val; logDiv.appendChild(inputEx.cn('br')); });