Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Annika Juul
April 20, 2004, 2:40 am
rate this thread
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
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.
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