On InitUI
document.addEventListener("deviceready",function(){
mosync.nativeui.initUI();
document.getNativeElementById("txtpassword").addEventListener("EditBoxEditingDidEnd", getPassword);
},true);
Get Password and convert into "*****" when editbox losts focus...
function getPassword(editBox,text)
{
var txtpwd=document.getNativeElementById("txtpassword");
Inputvalidation("txtpassword",function(unamex)
{
if(unamex!="")
{
txtpwd.setProperty("text",Array(unamex.length+1).join("*"));
}
});
}
Get Editbox value using getProperty method
function Inputvalidation(control,callback)
{
var value_out = "";
var editbox = document.getNativeElementById(control);
editbox.getProperty("text",
function(property, value)
{
value_out=value;
},
function()
{
alert("getProperty error");
});
setTimeout(function() { callback(value_out); }, 500);
}