On Thu, 14 Oct 2004 17:49:53 +0100, vastaso <va*****@hjjh.it> wrote:
Ciao, I have an hidden field and I want make it visible, setting its
"type"
[snip]
it works fine in Mozilla but fails in Internet Explorer 6.
Microsoft have taken the liberty of making the type property read-only[1].
It would be a better idea to hide the element when the document loads
using the style object, then making it visible later.
When the document loads:
var elemRef = ...;
if(elemRef && elemRef.style) {
elemRef.style.visibility = 'hidden'; // or .display = 'none';
}
When you want to show the element:
var elemRef = ...;
if(elemRef && elemRef.style) {
elemRef.style.visibility = ''; // or .display = '';
}
Hope that helps,
Mike
[1] Well, it can be written to once, but only it the element in question
has just been created with a document.createElement call.
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.