document.formname.textname.readOnly=true;

解决方案 »

  1.   


    READONLY Attribute | readOnly Property  Internet Development Index --------------------------------------------------------------------------------Sets or retrieves the value indicated whether the content of the object is read-only.SyntaxHTML <ELEMENT READONLY ... >  
    Scripting object.readOnly [ = bRead ] Possible ValuesbRead Boolean that specifies or receives one of the following values.false Default. Property is not set on the object. 
    true Object is set to read-only. 
     The property is read/write. The property has a default value of false.Expressions can be used in place of the preceding value(s), as of Microsoft&reg; Internet Explorer 5. For more information, see About Dynamic Properties.ResIf the value of the readOnly property is set to true, the user cannot enter or edit text in the control. When set to true, the property still allows the object to receive the focus, whereas the disabled property does not.Standards InformationThis property is defined in HTML 4.0  and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 . Applies ToTEXTAREA 
    Platform Version 
    Win16: 4.0 
    Win32: 4.0 
    Windows CE: 4.0 
    Unix: 4.0 
    Mac: 4.0 
    Version data is listed when the mouse hovers over a link, or the link has focus. 
     INPUT type=text, INPUT type=password, TEXTAREA 
    Move the mouse pointer over an element in the Applies To list to display availability information for the listed platforms.