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

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.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top