Preventing Text Box Entry

Results 1 to 2 of 2

Thread: Preventing Text Box Entry

  1. #1
    Join Date
    Dec 1969

    Default Preventing Text Box Entry

    Is there an easy way to prevent users from entering or changing data in a text box field. I want to have a text box whose value is the result of a calculation and make is so that users cant change or edit that field.<BR><BR>I have tried using the ONFOCUS event to display an alert and then set the focus to another box and that works ok except java doesnt seem to like my text box names. My text boxes have names like 1_1 and 2_4 and it gives me an error when I try to set focus to them like below. Any ideas?<BR><BR>function HandleChange() {<BR>frm=document.Step2Form;<BR>alert("You cant enter data in this box!");<BR>frm.1_1.focus();<BR>}<BR><BR>This doesnt work, but if I change the 1_1 to something like name,it works ok. Are there restrictions on form text box names?

  2. #2
    Arky Guest

    Default RE: Preventing Text Box Entry

    onFocus"this.Blur()"<BR><BR>thats IT

Posting Permissions

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