Hi,
Well, my first post on this forum.
Perhaps there is someone who can help me with this.
Why is the function "xFocus ()" not working.
I have already tried several ways to get it working.
I would like to have direct focus on the text field,
when the application starts.
Any help will be greatly appreciated.
____________________________________________________
Html>
<Head>
<SCRIPT language="JScript">
window.resizeTo(1,1);
window.moveTo(-1500,1);
</SCRIPT>
<hta:application
ID="oHTA"
applicationName="ASCII CODE"
caption="No"
windowstate="Normal"
/>
<SCRIPT language="JScript">
function position(iWidth,iHeight){
var iLeft = (window.screen.width-iWidth)/2;
var iTop = (window.screen.height-iHeight)/2;
window.moveTo(iLeft,0);
window.resizeTo(iWidth,iHeight);
try{
window.self.focus()
}
catch(ee){}
document.title = oHTA.applicationName
}
</SCRIPT>
<script type="text/javascript">
function xFocus() {
document.form1.login.focus();
}
</script>
<script type="text/javascript">
function displayunicode(e){
var unicode=e.keyCode? e.keyCode : e.charCode
alert (unicode)
}
</script>
</Head>
<Body onload="setTimeout('position(100,100)',0)"; "xFocus()">
<form name="form1">
<input type="text"
Style="Position:Relative;Width:45px;Height:20px"
Style="Background:aqua"
onkeyup="displayunicode(event); this.select()">
<form method="post">
<input type="button"
Style="width: 45px; height: 25px"
Style="background: Red"
Value="Close"
onclick="window.close()">
</form>
</body>
</html>
____________________________________________________
Kind regards
Utokia
Well, my first post on this forum.
Perhaps there is someone who can help me with this.
Why is the function "xFocus ()" not working.
I have already tried several ways to get it working.
I would like to have direct focus on the text field,
when the application starts.
Any help will be greatly appreciated.
____________________________________________________
Html>
<Head>
<SCRIPT language="JScript">
window.resizeTo(1,1);
window.moveTo(-1500,1);
</SCRIPT>
<hta:application
ID="oHTA"
applicationName="ASCII CODE"
caption="No"
windowstate="Normal"
/>
<SCRIPT language="JScript">
function position(iWidth,iHeight){
var iLeft = (window.screen.width-iWidth)/2;
var iTop = (window.screen.height-iHeight)/2;
window.moveTo(iLeft,0);
window.resizeTo(iWidth,iHeight);
try{
window.self.focus()
}
catch(ee){}
document.title = oHTA.applicationName
}
</SCRIPT>
<script type="text/javascript">
function xFocus() {
document.form1.login.focus();
}
</script>
<script type="text/javascript">
function displayunicode(e){
var unicode=e.keyCode? e.keyCode : e.charCode
alert (unicode)
}
</script>
</Head>
<Body onload="setTimeout('position(100,100)',0)"; "xFocus()">
<form name="form1">
<input type="text"
Style="Position:Relative;Width:45px;Height:20px"
Style="Background:aqua"
onkeyup="displayunicode(event); this.select()">
<form method="post">
<input type="button"
Style="width: 45px; height: 25px"
Style="background: Red"
Value="Close"
onclick="window.close()">
</form>
</body>
</html>
____________________________________________________
Kind regards
Utokia