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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification