JavaScript "TextBox.Select()" function problem with new .NET 2.0 browser control

  • Thread starter Thread starter subbarao.puvvada
  • Start date Start date
S

subbarao.puvvada

Hi All,


I am working on a Windows application, Which browser control on main
form itself develped in .NET 1.1. Recently we have migrated it to .NET
2.0. It's combination of Web pages and .NET Windows forms. We have
complete web application also. After we convert this application
from .NET 1.1 to .NET 2.0, if we select all text in textbox onfocus
event of textbox, again I am unable to Unselect the selected text with
mouse.

Can any one you experienced the same problem. If Yes, please let me
know how you resolve that issue.


Here is my sample code:


HTML page:



<html>
<head>
<script language='javascript'>
function SelectAll(FieldNo)
{
switch (FieldNo)
{
case 1 :
{
Login.User.select();
break;
}

case 2 :
{
Login.Password.select();
break;
}
}
}
</script>
</head>
<body>
<form method="GET" name="Login" action>
<input type="text" name="User" onfocus="SelectAll(1)"><br>
<input type="text" name="txt2">
</form>
</body>
</html>



Thanks,

Subbarao.
 
Hi All,


I am working on a Windows application, Which browser control on main
form itself develped in .NET 1.1. Recently we have migrated it to .NET
2.0. It's combination of Web pages and .NET Windows forms. We have
complete web application also. After we convert this application
from .NET 1.1 to .NET 2.0, if we select all text in textbox onfocus
event of textbox, again I am unable to Unselect the selected text with
mouse.

Can any one you experienced the same problem. If Yes, please let me
know how you resolve that issue.

That is probably because the field recieves focus when you click in it.
 
Back
Top