Making a fiels read only

Results 1 to 4 of 4

Thread: Making a fiels read only

  1. #1
    Join Date
    Dec 1969
    Posts
    119

    Default Making a fiels read only

    How can I make a text field read only? Is there a way in HTML or javascript or vbscript?<BR><BR>Please help.<BR>Thanks<BR>Arvind

  2. #2
    Join Date
    Dec 1969
    Posts
    511

    Default RE: Making a fiels read only

    You could write a javascript onchange event to rewrite the contents any time the user changes them. Might go like this :<BR><BR>&#060;snip><BR><BR>&#060;script language="javascript"><BR>!--<BR>function ResetMe() {<BR> MyForm.MyText.Value = &#039&#060;%= Session("MyValue")&#037;&#062;&#039<BR>}<BR><BR>&# 060;Form name="MyForm" Method="Post" Action="MyScript.asp"><BR>&#060;input type="text" Name="MyText" onChange="ResetMe()" Value="&#060;%= Session("MyValue") &#037;&#062;"><BR>&#060;/form><BR><BR>&#060;snip><BR><BR>Well something like that ;)<BR><BR>hope that helps<BR><BR>Pete

  3. #3
    Dan Mellick Guest

    Default RE: Making a fiels read only

    Yes,<BR><BR>Put the phrase READONLY inside your input HTML Tags:<BR><BR>&#060;input type="text" name="myName" value="myValue" READONLY><BR><BR>Note: no quotes around the phrase.<BR><BR>Hope this helps.....

  4. #4
    Joseph Hatcher Guest

    Default RE: Making a fiels read only

    The solution <BR><BR>&#060;input type="text" name="myName" value="myValue" readonly><BR><BR>seems to work for Internet Explorer but I can not get it to work on Netscape<BR><BR>For both browsers, I use the following<BR><BR>&#060;input type="text" name=myName" onfocus="this.blur()"><BR><BR>


Posting Permissions

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