Could you do:
<cfif iseditable>
<input type="text" name="field" value="#fieldvalue#">
<cfelse>
#fieldvalue#
<input type="hidden" name="field" value="#fieldvalue#">
</cfif>
An even cooler thing would be to use IE's "disabled" attribute, but
unfortunately that only works for IE 5 and up.
<cfif iseditable>
<input type="text" name="field" value="#fieldvalue#">
<cfelse>
<input type="text" name="field" value="#fieldvalue#" disabled>
</cfif>
I wish it worked for all browsers though. Being able to disable a form
control is a "good thing" as Martha Stewart would say.
- Sean
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sean Daniels
Manager of Engineering
DealStream, Inc.
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tel: 207.439.6030
cel: 978.764.0799
Fax: 240.269.6319
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 03, 2000 3:03 PM
> To: [EMAIL PROTECTED]
> Subject: same form-based page for edit and display?
>
>
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm writing an app in cold fusion that has users who are in different
> roles and who may be viewing some data they dhouldn't edit or may be
> editing that data, depending on the role and situation.
>
> I'm trying to write it in such a way that I use on cfm page that
> has the option set in a flag whether to be read only.
>
> Right now it is a form with a onClick function used in each field
> that either does nothing or does a blur() and pops a message "you can't
> edit"(basically).
>
> I'd like to make it look better or at least different when it is in
> read-only mode - for instance have it not be a form field but just some
> text, or a form field of a different color (is that possible)?
>
> Any advice would be appreciated.
>
>
> John Holland
> - ---------------
>
> Email: [EMAIL PROTECTED]
> Web: http://jbhsoft.linuxave.net
> Public key : finger -s or
> http://jbhsoft.linuxave.net/pubkey.html
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGP 6.5.2
>
> iQA/AwUBOOjq9xPWCCE2yAKHEQJgpgCZAZIBy2Y0NuBOtnT0oOUnl7AE3AoAoKpr
> eptMA0eZLx4kbhr/m/+Ofu1S
> =W9nl
> -----END PGP SIGNATURE-----
>
> ------------------------------------------------------------------
> ------------
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
_talk or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.