Results 1 to 4 of 4

Thread: Read-Only Div Block

  1. #1
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,626
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default Read-Only Div Block

    Hi all,

    Is it possible to achieve a pure read-only div block. As you are aware contentEditable and unselectable works only in IE but I am looking for a method which is compatible with both IE and Mozilla Firefox.

    Thanks in advance.

    Regards

    CodeExploiter

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,925
    Thanks
    43
    Thanked 3,190 Times in 3,154 Posts
    Blog Entries
    12

    Default

    Division elements on an HTML page are normally read-only.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,626
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    Division elements on an HTML page are normally read-only.
    I think I haven't provided one valuable information. I need a read-only <div> block within a rich-text editor which is based on JavaScript. I want to create a section which is not editable for the users of the editor.

    Code:
    <div contentEditable='false' unselectable='true'></div>
    The above code working as I wanted in IE. I am looking for a method which will work both in IE and Firefox or even a Firefox based method will do good for me.

  4. #4
    Join Date
    Feb 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    In my case these attributes dot' work at all event in IE:

    Code:
    <html >
    <body>
    
    
    <div contentEditable='false' unselectable='true' style="disabled:true" > 
    		<span dir="ltr"><input name="ctl00$PlaceHolderMain$ctl01$ctl00$FormField1$ctl00$ctl00$onetidIOFile" type="text" value="!!! 1, 987 ?? 10.2.12" maxlength="123" id="ctl00_PlaceHolderMain_ctl01_ctl00_FormField1_ctl00_ctl00_onetidIOFile" title="---" class="ms-long" Size="35" /></span>
     </div>
    
     </body>
    
    </html>
    The textbox still allows me entering and keystrokes. I wonder how to disable it indirectly (via manipulation with proper <DIV> attributes and styles).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •