I had asked the mosync community but there seems to be an inactive community. The question is more javascript as well.
I have a widget editBox defined as
on top of my page is my javascript files (i.e. warmhole.js) and a custom function defined as follows
The problem is word2 is blank. the line word2=value is working fine as its output is ok. But after it gets out of the getproperty function, word2 seems to be reset to blank. What am i missing?
I have a widget editBox defined as
Code:
<div data-widgetType="EditBox" id="searchword" data-width="FILL_AVAILABLE_SPACE" data-text=""data-fontSize="26"> </div>
Code:
function getEntry(){
var word2="";
var searchtextctrl=document.getNativeElementById("searchword");
//read its text property now then save it to word2 var
searchtextctrl.getProperty("text",
function(property,value)
{
word2=value;
},
function()
{
word2="";
}
);
}
//if (!word2) { //tried as well (word=="")
//no entry
}
Comment