Microsoft KB Archive/254095

= FP2000: How to Disable Text Boxes for Netscape Navigator and Internet Explorer =

Article ID: 254095

Article Last Modified on 12/2/2000

-

APPLIES TO


 * Microsoft FrontPage 2000 Standard Edition

-



This article was previously published under Q254095



SUMMARY
In some situations, you want to display information from a database in a disabled text field. This article explains how to disable a text field for both Microsoft Internet Explorer and Netscape Navigator.



MORE INFORMATION
You need different methods to disable a text field on your web page for Netscape Navigator and Internet Explorer.

One way to work around this problem is to use JavaScript to do browser detection and dynamically generate your HTML, based on the browser version; however, this method can clutter your page. Also, this is not efficient, if all you are trying to do is disable a text field.

Another way to disable a text field is to place the ReadOnly and onFocus attributes in the same text field tag. To do this, follow these steps:

 Open or create a new Normal page in FrontPage. On the Insert menu, point to Form, and then click One-Line Text Box. Click the HTML tab.  In the tags, change the following HTML code from  to the following HTML code:   Click the Normal tab, and save your page.</ol>

This method works for Internet Explorer, because it supports the ReadOnly attribute on the input tag and ignores the onFocus attribute.

This method works for Netscape Navigator, because it ignores the ReadOnly attribute and runs the blur method, which removes the insertion point from the field.

This method creates a text field in both browsers that the user cannot edit. The text field still has all the JavaScript flexibility of an HTML text field.

NOTE: In Microsoft Internet Explorer, you can use the ReadOnly=True code to disable the text field. The Dynamic HTML/HTML object model of Netscape Navigator does not support elements such as ReadOnly=True or Disabled=True; however, you can blur the focus of the text field. If you programmatically blur the focus in Internet Explorer, the browser leaves a flashing insertion point in your text field. This can create incompatibilities with disabling a text box.

The flashing insertion point may not seem like a problem, but if there is data in the field and the user selects the field, the user sees an insertion point. If the user wants to clear the data in the field, they press BACKSPACE. The BACKSPACE key is a shortcut for the Back button in Internet Explorer, so the Web browser goes back a page. This can possibly result loss of data in the form fields.

The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Additional query words: front page fp2000

Keywords: kbinfo KB254095

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.