Connecting Tech Pros Worldwide Forums | Help | Site Map

Disable form input in IE7

Kim
Guest
 
Posts: n/a
#1: Jun 27 '08
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 ?

Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#2: Jun 27 '08

re: Disable form input in IE7


Kim wrote:
Quote:
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)
Quote:
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;
Quote:
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, <f806at$ail$1$8300dec7@news.demon.co.uk>
Kim
Guest
 
Posts: n/a
#3: Jun 27 '08

re: Disable form input in IE7


On May 15, 12:18 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
Quote:
Kim wrote:
Quote:
I have a problem with IE7.
>
Quote:
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)
>
Quote:
I havent seen this reported before.
>
Quote:
Code:
document.Form.Field.disabled = true;
>
You better use the standards-compliant syntax:
>
document.forms["Form"].elements["Field"].disabled = true;
>
Quote:
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, <f806at$ail$1$8300d...@news.demon.co.uk>
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 :)
Closed Thread