Disable form input in IE7

K

Kim

I have a problem with IE7.

In Firefox2 and IE6 can I disable an input field in a form without any
problems, yet it doesnt work in IE7.
I havent seen this reported before.

Code:
document.Form.Field.disabled = true;


What is needed to make it work in all 3 browsers ?
 
T

Thomas 'PointedEars' Lahn

Kim said:
I have a problem with IE7.

In Firefox2 and IE6 can I disable an input field in a form without any
problems, yet it doesnt work in IE7.

Are you sure? WFM, although the background color does not change automatically.

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET
CLR 2.0.50727)
I havent seen this reported before.

Code:
document.Form.Field.disabled = true;

You better use the standards-compliant syntax:

document.forms["Form"].elements["Field"].disabled = true;
What is needed to make it work in all 3 browsers ?

That depends on which of the many other browsers out there you consider the
third one.


PointedEars
 
K

Kim

Kim said:
I have a problem with IE7.
In Firefox2 and IE6 can I disable an input field in a form without any
problems, yet it doesnt work in IE7.

Are you sure? WFM, although the background color does not change automatically.

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET
CLR 2.0.50727)
I havent seen this reported before.
Code:
document.Form.Field.disabled = true;

You better use the standards-compliant syntax:

document.forms["Form"].elements["Field"].disabled = true;
What is needed to make it work in all 3 browsers ?

That depends on which of the many other browsers out there you consider the
third one.

PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <[email protected]>

I did mention all 3 browsers (IE6, IE7 and Firefox).

But turns out the problem was a human error :(
I had forgotten to call the function in which the above line was used.
So WFM too after all :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top