Just FYI. We did use Javascript to do this (similar to code below). It
worked fine in IE 4+, intermittent problems in Netscape 4+. Also, we found
that people would turn off Javascript (for whatever reason) and whamo, no go
on keeping them out. So if you are counting on this for some security reason
or other process, make sure to first check for Javascript support and then
not let them into the page if they do not have javascript enabled.

-Gary

> -----Original Message-----
> From: Jason Powers [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 31, 2000 9:52 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: (OT) making fields readonly with JavaScript
>
>
> Jamie,
>   Shouldn't it be possible for you to use the blur() method to force focus
> off of that text box?  Like this:
> <input type="text" onFocus="this.blur();">
> to take focus off of that field, or
> <input type="text" onFocus="document.forms[0].someotherelement.focus()">
> to focus on another element, which would actually be rather confusing for
> the user.
> If that doesn't work, you might be able to do something like this:
> <script>var myval;</script>
> <input type="text" onFocus="myval=this.value;" onBlur="this.value=myval;">
> to replace the value in the field with its previous value.
>
> -----Original Message-----
> From: Jamie Keane [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 31, 2000 9:51 AM
> To: CFTalk
> Subject: (OT) making fields readonly with JavaScript
>
>
> Hi all, and I apologise for being off-topic, but this is driving me nuts!
>
> Is there a way to "disable" text field via JavaScript?  I know of the
> READONLY attribute, and the client likes how that works, but in
> my research
> I was not able to come up with a way to access that attribute through JS.
> Any ideas?
>
> Thanks,
> Jamie
>
> --
> Jamie Keane
> Programmer
> SolutionMasters, Inc.
> 9111 Monroe Rd., Suite 100
> Charlotte, NC  28270
> www.solutionmasters.com
> 704.563.5559 x 228  Voice
> 704.849.9291  Fax
>
> ------------------------------------------------------------------
> ----------
> --
> Archives: http://www.mail-archive.com/[email protected]/
> 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.mail-archive.com/[email protected]/
> 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.mail-archive.com/[email protected]/
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.

Reply via email to