Skip to content

Instantly share code, notes, and snippets.

@codeinvain
Created June 29, 2010 19:51
Show Gist options
  • Save codeinvain/457718 to your computer and use it in GitHub Desktop.
Save codeinvain/457718 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>HtmlTextInput host</title>
<style>
#htmlInput
{
position: absolute;
top: 0px;
left: 0px;
display: none;
text-align: right;
direction: rtl;
border: 0px solid black;
padding: 1px 1px 1px 1px;
margin: 0px 0px 0px 0px;
}
</style>
<script>
function enterTextField(posX, posY, width, height, value, fontSize, fontFamily)
{
if (value==null)
value="";
var inp = document.getElementById("htmlInput");
inp.value = value;
inp.style.width = (width - 2) + "px";
inp.style.height = (height - 2) + "px";
inp.style.left = posX + "px";
inp.style.top = posY + "px";
inp.style.fontSize = fontSize;
inp.style.fontFamily = fontFamily;
inp.style.backgroundColor="white";
inp.style.border="0px solid black";
inp.style.display = "block";
setTimeout('document.getElementById("htmlInput").focus()',100);
inp.onblur = function ()
{
this.style.display="none";
//document.getElementById("store").finishUpdateFlashTextField(this.value);
}
inp.onkeyup = function(e){
if (e.keyCode==13){
this.style.display="none";
document.getElementById("flexHtmlElementId").finishUpdateFlashTextField(this.value);
document.getElementById("flexHtmlElementId").focus();
}
else
{
document.getElementById("flexHtmlElementId").updateFlashTextField(this.value);
}
});
}
</script>
</head>
<body>
<--embed your flex application here-->
<input type="text" id="htmlInput" name="htmlInput" value="" onkeypress="return isValid(event)" />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment