Making input box uneditable

Results 1 to 6 of 6

Thread: Making input box uneditable

  1. #1
    Simpleton Guest

    Default Making input box uneditable

    I have an input box which updates when a value is entered in another box. Is it possible to set the field to uneditable so the results are not altered?

  2. #2
    Join Date
    Dec 1969

    Default Plenty of ways:

    &#060;input type="text" value="0" readonly&#062;<BR>&#060;input type="text" value="0" disabled&#062;<BR>&#060;input type="text" value="0" onFocus="this.blur();"&#062;<BR><BR>The last method will work in Netscape as well.

  3. #3
    Join Date
    Dec 1969

    Default You don't want the user to edit it?


  4. #4
    Join Date
    Dec 1969

    Default CheezWhiz is right

    Use one of those functions, but you need to first decide if a user updated your other box in order to make this one read only.<BR><BR>Make a global boolean variable, and initialize it to false<BR><BR>var myvar = false;<BR><BR>When the user updates the value, set myvar = true<BR><BR>Then, using CheezWhiz&#039;s code:<BR><BR>&#060;INPUT TYPE... onfocus="if (myvar) this.blur();"&#062;

  5. #5
    Join Date
    Dec 1969

    Default RE: or..

    or this:<BR>...<BR>function GoNext()<BR>{<BR>var txt = "";<BR>txt = document.form1.txtNext.focus();<BR>}<BR>...<BR>&#0 60;input type="text" value="1" onFocus="GoNext();"&#062; <BR>&#060;input type="text2" name=txtNext value="2"&#062; <BR><BR><BR>

  6. #6
    simpleton Guest

    Default Thanks all....

    I continued searching for an answer after I posted this and finally came across the solution at Sorry to have bothered you and thanks for your help.<BR><BR>The simple one!

Posting Permissions

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