I have a form with some input text fields, and I am toggling them between
readOnly and enterable, using JavaScript. In Mozilla, when the input is set
to readOnly, the background is greyed out automatically, which is nice, but
not in IE. If I explicitly set the background color to grey with my
JavaScript, I get a 3D inset border style. I could explicitly set the border
style at the same time, but I don't know what I need to match whatever the
default is. Any ideas?
Thank you 3 23462
"Gary Homewood" wrote I have a form with some input text fields, and I am toggling them between readOnly and enterable, using JavaScript. In Mozilla, when the input is
set to readOnly, the background is greyed out automatically, which is nice,
but not in IE. If I explicitly set the background color to grey with my JavaScript, I get a 3D inset border style. I could explicitly set the
border style at the same time, but I don't know what I need to match whatever the default is. Any ideas?
Probably best to asume different defaults in different browsers, so no
explicit border declarations is going to help. Perhaps setting the empty
string ( someElement.style.border=''; ) is your best chance at getting the
default view.
Q1: Doesn't IE display the readonly-ness in any other way? Couldn't you use
disabled instead of readonly? IE displays disabled items with a faded font
colour.
Q2: Bit strange that your *border* changes when you play with the
*background*. Isn't there a mix up somewhere?
HTH
Ivo
"Duncan M." <no@email.please> wrote in message
news:<40**********************@news.wanadoo.nl>... "Gary Homewood" wrote I have a form with some input text fields, and I am toggling them
between readOnly and enterable, using JavaScript. In Mozilla, when the input is set to readOnly, the background is greyed out automatically, which is nice, but not in IE. If I explicitly set the background color to grey with my JavaScript, I get a 3D inset border style. I could explicitly set the border style at the same time, but I don't know what I need to match whatever
the default is. Any ideas?
Probably best to asume different defaults in different browsers, so no explicit border declarations is going to help. Perhaps setting the empty string ( someElement.style.border=''; ) is your best chance at getting the default view.
I agree, I don't want to explicitly have to set a border style. I tried
setting the
border as an empty string, and I just got nothing as a border (!) Q1: Doesn't IE display the readonly-ness in any other way? Couldn't you
use disabled instead of readonly? IE displays disabled items with a faded font colour.
I may be missing something, but IE doesn't seem to do anything with the
readOnly-ness.
I tried disabled instead of readOnly, but I don't want the text to have a
faded font,
and once the input is set to disabled it seems you can't set any other style
(like
setting the font to black, for example).
Q2: Bit strange that your *border* changes when you play with the *background*. Isn't there a mix up somewhere?
I know, it does seem strange. That's what it does, though, honest!
HTH Ivo
Yes, I know the problem, as soon as You set the Background with JS, You get
this silly problem in IE.
document.getElementById(element).style.backgroundC olor='#FFFFCC';
Workaround is to define a stylesheet definition for all inputs.
INPUT, TEXTAREA, SELECT, OPTION {
border: 1px solid threedshadow;
}
Attention this causes checkboxes also to have a border unless You define a
special class for them to supress this:
..noBorder {border: none;}
Regards,
Michael
"Gary Homewood" <ga***********@hotmail.com> schrieb im Newsbeitrag
news:40***********************@lovejoy.zen.co.uk.. . I have a form with some input text fields, and I am toggling them between readOnly and enterable, using JavaScript. In Mozilla, when the input is
set to readOnly, the background is greyed out automatically, which is nice,
but not in IE. If I explicitly set the background color to grey with my JavaScript, I get a 3D inset border style. I could explicitly set the
border style at the same time, but I don't know what I need to match whatever the default is. Any ideas?
Thank you
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Matt |
last post by:
what's the differences between readonly and disabled attribute??
When I do the post, it couldn't get both values <%= fname %>. any ideas??
<input type="text" name="fname" value="Joe" readOnly>...
|
by: datactrl |
last post by:
HI, all
I found the return value from obj.readOnly is always the original vaule in
HTML setting, even after doing obj.readOnly=true/false. How can I get the
real time value set by javascript?
...
|
by: Hamish |
last post by:
I have an input box which is created with the readonly option included. Is
it possible to turn this off.
This is so the input box is not selectable untill a radio button is switched
on.
I...
|
by: Randell D. |
last post by:
Folks,
I have a few <INPUT TYPE=TEXT> tags that are readonly if a specific
field has no value... these work fine. However, I also have checkboxes
which I would like to have as readonly, but the...
|
by: upersson |
last post by:
Hi!
When accessing my web page I build up the javascript and html
dynamically. Depending on an parameter I want to set all the fields
(input tags) readonly. How do I do this? Of course I can...
|
by: Jimbo |
last post by:
Hi,
I am trying to set the readonly attribute of a text input tag dynamically
from javascript. The input element already exists in the form and I want to
make it readonly when a particular...
|
by: Hamed |
last post by:
Hello
I have a DataGrid object in my ASP.NET page that has the following template
column. When I put the "readonly" attribute in the INPUT tag, it generates
readonly="".
<asp:TemplateColumn...
|
by: J. McConnell |
last post by:
I am having trouble with the following code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
|
by: Cecil Westerhof |
last post by:
I have the following code in a xslt-file:
<xsl:template match="outputfield">
<xsl:for-each select='.'>
<tr>
<td class = "inputDescription"><xsl:value-of select='.' />:</td>
<td><input class =...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |