Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Does anyone know which property to add to a tag in order to enter a specific
text in a field that the user cannot change?

Re: Forms

Quoted text here. Click to load it

you could use: readonly or disabled.

e.g. <input name="blahdeblah" value="blah" readonly>

but they don't prevent the visitor from changing the fields. your normal
server side validation needs to be used to pick up icky bits.

b  r  u  c  i  e

Re: Forms

On Mon, 19 Apr 2004 21:40:42 -0500, Annika Juul wrote:

Quoted text here. Click to load it

If the user can't change it it's not very well a form field, is it?  Use
normal text.  If you're using a textarea to get a small, scrolling region
consider using a more appropriate container with the overflow CSS property
set to 'auto'.  Or don't; the browser comes with a scrollbar for a reason.

If you need to pass a value to the client to be passed back to the server,
consider using a cookie or a hidden (not disabled) field; both can still
be changed by a sufficiently interested user, and must be verified (as
brucie points out).

Some say the Wired doesn't have political borders like the real world,
but there are far too many nonsense-spouting anarchists or idiots who
think that pranks are a revolution.

Re: Forms

Quoted text here. Click to load it

You can use either the "readonly" or "disabled" attributes.
However, it is a pretty big usability problem to display a form element that
cannot be changed.
How about using <input type="hidden"> for the element instead? This will
prevent the user from even seeing the element and thinking they can change


Site Timeline