Search:
Namespaces
Discussions
.NET v1.1
Feedback
Readonly/Enabled for textbox in Netscape fails
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngclient' list
.
Chuck Peper
-- Moved from [aspngfreeforall] to [aspngclient] by Tim Musschoot <
Click here to reveal e-mail address
> --
I can't get Readonly or Enabled to work in Netscape 4.7 for a textbox.
I created a very simple aspx page with 2 textbox's and then set the
readonly=t and enabled=F properties.
In Netscape 4.7 it didn't work.
aspx page below
<HTML>
<HEAD>
<meta name="vs_targetSchema"
content="
http://schemas.microsoft.com/intellisense/nav4-0"
;>
</HEAD>
<body MS_POSITIONING="FlowLayout">
<form id="Form1" method="post" runat="server">
<P>read only
<asp:TextBox id="TextBox1" runat="server" ReadOnly="True">
</asp:TextBox></P>
<P>enabled
<asp:TextBox id="TextBox2" runat="server" Enabled="False">
</asp:TextBox></P>
</form>
</body>
</HTML>
Private Sub Page_Load(ByVal sender As System.
Object
, ByVal e As
System.EventArgs) Handles MyBase.Load
TextBox1.Text = "readonly " & TextBox1.ReadOnly.ToString
TextBox2.Text = "enabled " & TextBox2.Enabled.ToString
End Sub
Netscape 4.7 rendering below
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<meta name="vs_targetSchema"
content="
http://schemas.microsoft.com/intellisense/nav4-0"
;>
</HEAD>
<body MS_POSITIONING="FlowLayout">
<form name="Form1" method="post" action="webform3.aspx" id="Form1">
<input type="hidden" name="__VIEWSTATE"
value="dDwtMTM1ODU0MTM1Mzt0PDtsPGk8MT47PjtsPHQ8O2w8aTwxPjtpPDM+=" />
<P>read only
<input name="TextBox1" type="text" value="readonly True"
readonly="readonly" id="TextBox1" />
</P>
<P>enabled
<input name="TextBox2" type="text" value="enabled False" id="TextBox2"
disabled="disabled" />
</P>
</form>
</body>
</HTML>
Reply to this message...
Peter Brunone
Chuck,
Unfortunately, that's because there is no such property in Netscape 4.7.
Instead, to create a read-only textarea, you need to add some workaround
code. You can use style tags to make the background color gray, and then
use a Javascript event handler to deflect clicks, e.g.
onFocus="window.focus()".
Of course you may be stuck using a regular HTML input tag instead of a
textbox if you need to do this, since the textbox control doesn't appear to
have a method for adding attributes. Then again, you could always build a
custom control :)
Regards,
Peter
|-----Original Message-----
|From: Chuck Peper [mailto:
Click here to reveal e-mail address
]
|
|I can't get Readonly or Enabled to work in Netscape 4.7 for a textbox.
|
|I created a very simple aspx page with 2 textbox's and then set the
|readonly=t and enabled=F properties.
|
|In Netscape 4.7 it didn't work.
|
|aspx page below
|<HTML>
|<HEAD>
| <meta name="vs_targetSchema"
|content="
http://schemas.microsoft.com/intellisense/nav4-0"
;>
|</HEAD>
|<body MS_POSITIONING="FlowLayout">
| <form id="Form1" method="post" runat="server">
| <P>read only
| <asp:TextBox id="TextBox1" runat="server" ReadOnly="True">
| </asp:TextBox></P>
| <P>enabled
| <asp:TextBox id="TextBox2" runat="server" Enabled="False">
| </asp:TextBox></P>
| </form>
|</body>
|</HTML>
| Private Sub Page_Load(ByVal sender As System.
Object
, ByVal e As
|System.EventArgs) Handles MyBase.Load
| TextBox1.Text = "readonly " & TextBox1.ReadOnly.ToString
| TextBox2.Text = "enabled " & TextBox2.Enabled.ToString
| End Sub
|
|
|
|Netscape 4.7 rendering below
|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|<HTML>
| <HEAD>
| <meta name="vs_targetSchema"
|content="
http://schemas.microsoft.com/intellisense/nav4-0"
;>
| </HEAD>
| <body MS_POSITIONING="FlowLayout">
| <form name="Form1" method="post" action="webform3.aspx" id="Form1">
|<input type="hidden" name="__VIEWSTATE"
|value="dDwtMTM1ODU0MTM1Mzt0PDtsPGk8MT47PjtsPHQ8O2w8aTwxPjtpPDM+=" />
|
| <P>read only
| <input name="TextBox1" type="text" value="readonly True"
|readonly="readonly" id="TextBox1" />
|</P>
|<P>enabled
|<input name="TextBox2" type="text" value="enabled False" id="TextBox2"
|disabled="disabled" />
|</P>
|</form>
|</body>
|</HTML>
|
Reply to this message...
System.EventArgs
System.Object
System.Web.UI.MobileControls.TextBox
System.Web.UI.WebControls.TextBox
System.Windows.Forms.TextBox
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com