[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Read Only Form Input Fields
No, it doesn't work (at least on Solaris X).
BTW: I discovered very annoying (or funny) feature when trying this.
I copied quickly to my editor a line suggested by Masoud
(onFocus...) and forgot to change names (myNextText...) to
correspond with my form. Then I loaded document to Navigator
(on Solaris X). When I approached the first text field (with
onFocus.. event handler) I got JS alert window with message
that myNextText is not defined. It was correct - but funny was
that I was getting this alert messsage each time when my mouse touched
the Navigator (anywhere, not only in the text field, even when I
touched a header bar added to Navigator by X-window manager).
I had to prepare my fingers on keyboard (Alt-R for reloading), then
move by other hadn my mouse, and then be quicker than JS alert.
I did it finally, but it is surely a bug...
Martin
>
> 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/
>
--
------------------------------------------------------
| 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/