[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Read Only Form Input Fields



Frends,
 The best way is to do the following:
   onFocus="myNextText.select();myNextText.focus();"
Masoud.


Begin forwarded message:

From: Martin Senger <M.Senger@dkfz-heidelberg.de>
Subject: Re: Read Only Form Input Fields
To: javascript@obscure.org
Date: Fri, 8 Mar 1996 09:33:56 +0100 (MET)
In-Reply-To: <313F4D7F.6E92@dircon.co.uk> from "Daniel Grealy" at  
Mar 7, 96 08:56:31 pm
Sender: owner-javascript@obscure.org
Reply-To: javascript@obscure.org

>
> Grady Russell wrote:
> >
> > On my pages, I keep getting users calling it Java when its  
JavaScript. Its
> Does any one know how to implement read only text fields in a
> form. The scenario is this. I have developed an order processing
> system using Javascript and forms. The user types a product code and
> my script looks this up and fills in a description and price fields. 
>
> I do not want the  user to be able to change these.
>
I have done it in onChange (or onBlur) handler in the field I want
to have it read-only. Just to put back a original value:

   ...onChange="this.value=this.defaultValue">

But, I have heard the rumour that in the future we will have a  
possibility
to disable (grayed) a field. Maybe that will be the right way for read-
only purposes.

Regards,
Martin

------------------------------------------------------
| Martin Senger     m.senger@dkfz-heidelberg.de      |
|                   voice: (0049) 6221/422340        |
|                   fax:   (0049) 6221/422333        |
------------------------------------------------------
--------------------------------------------------------------------
For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/
--------------------------------------------------------------------
For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/