Is there an easy way to protect a text form field or label field, ie. non-editable ?
Thanks
make it a hidden field
no no, I want it to be read only and also be able to pass back to $PHP_SELF in array format ie
<input type=text name=pfield[] value=$var>
Is there a different type of field for this ?
using the following will work: <INPUT NAME='pfield[]' TYPE='text' VALUE='$var' READONLY>
Note: will work in Internet Explorer but not Netscape 4.x
Use JavaScript...
<input type=text name=pfield[] value=$var onFocus="this.blur()" onBlur="alert ('This field cannot be edited. You are in view mode.')">
Hidden field will get the job done.
I use it a lot in my projects just do
<INPUT TYPE=HIDDEN value=$value NAME=pfield[]>and you can echo "$value";
Di
Do you want it to be VIEWABLE or do you just want the data to be available? If you want it to be VIEWABLE but NOT editable, use JavaScript. Otherwise, use HIDDEN as suggested by Craig H and Dmitriy Nesterkin.
This is a though, but I have voted for the java option as I wanted the field to be protected but readable.
Thanks all have helped.