.NETGURU
CrossBrowser TextBox
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngreuse' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Chuck Peper (VIP)
I was thinking of making a cross browser text box. The MS textbox doesn't
support the readonly or enabled attribute for Netscape 4 browsers.

This can be simulated by adding an onfocus="blur;" attribute.

I've made some dinky server controls. But I haven't seen any examples on
how I could inherit the textbox and then add/remove this attribute whenever
the readonly or enabled property is set or changed in the parent
object. Would also be nice to check to see if the user has already set
something to the onfocus, so I don't overwrite it.

p.s., other than trial and error is there anyway to know whether the
browser supports the enabled/readonly attributes for input buttons?

Reply to this message...
 
    
Andy Smith
dGhlIGlkZWEgc291bmRzIGxpa2UgYSBnb29kIG9uZSB0byBtZS4NCiANCmluIG9yZGVyIHRvIGFk
ZCB0aGUgYXR0cmlidXRlLCBvdmVycmlkZSBBZGRBdHRyaWJ1dGVzVG9SZW5kZXIgd2l0aCBzb21l
dGhpbmcgbGlrZSB0aGlzDQogDQpwcm90ZWN0ZWQgb3ZlcnJpZGUgQWRkQXR0cmlidXRlc1RvUmVu
ZGVyKCBIdG1sVGV4dFdyaXRlciB3cml0ZXIgKSB7DQogICBpZiAoIEVuYWJsZWQgPT0gZmFsc2Ug
KSB7DQogICAgd3JpdGVyLkFkZEF0dHJpYnV0ZSgib25mb2N1cyIsICJibHVyKCk7IiApOw0KICB9
DQogIGJhc2UuQWRkQXR0cmlidXRlc1RvUmVuZGVyKHdyaXRlcik7DQp9DQogDQphcyB0byBkZXRl
cm1pbmluZyB3aGljaCBicm93c2VycyBkb24ndCBzdXBwb3J0IGl0Li4uDQp3aG8gY2FyZXM/IGkg
ZG9uJ3QgaG93IGl0IGNvdWxkIGh1cnQgYW55dGhpbmcgdG8gYWx3YXlzIGFkZCBpdD8NCiANCg0K
CS0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tIA0KCUZyb206IENodWNrI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m93c2VyIHN1cHBvcnRzIHRoZSBlbmFibGVkL3Jl
YWRvbmx5IGF0dHJpYnV0ZXMgZm9yIGlucHV0IGJ1dHRvbnM/DQoJDQoJDQoJfCBbYXNwbmdyZXVz
ZV0gbWVtYmVyIEFuZHkuU21pdGhAbWFjdGVjLmNvbSA9IFlPVVIgSUQNCgl8IGh0dHA6Ly93d3cu
YXNwZnJpZW5kcy5jb20vYXNwZnJpZW5kcy9hc3BuZ3JldXNlLmFzcCA9IEpPSU4vUVVJVA0KCQ0K
DQo
Reply to this message...
 
    
Trevor Pinkney
Andy's way is way better than the one I posted!

I didn't know you could do that. Cool!

-Trevor

At 04:47 PM 7/6/2002 -0600, you wrote:
[Original message clipped]

Reply to this message...
 
    
Chuck Peper
The only pain about allways adding it is, users can't copy from the text
box.

"Andy Smith" <Click here to reveal e-mail address> wrote in message
news:679736@aspngreuse...
[Original message clipped]

Reply to this message...
 
    
Trevor Pinkney
Hey Chuck,

maybe something like

public class ChuckBox : System.UI.WebControls.TextBox
{
protected override onPreRender(object src, EventArgs e)
{
if(this.readonly==true || this.enabled==false)
{
//TODO - ensure onfocus does not already have
stuff in it.
this.attributes["onfocus"] = "this.blur();"
}
}
}

How many people are still using crappy netscape?
www.thecounter.com/stats
http://www.thecounter.com/stats/2002/May/browser.php

its almost down to 0% thank god!

-Trevor

At 12:02 PM 7/5/2002 -0600, you wrote:
[Original message clipped]

Reply to this message...
 
 
System.EventArgs
System.Web.UI.HtmlTextWriter
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