473,406 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

changing input.type error with IE

Ciao, I have an hidden field and I want make it visible, setting its "type"
to "text" from a popup window.
I'm using this code:
window.opener.document.forms['formInsegnamenti'].elements['giorni_1'].type
='text';

it works fine in Mozilla but fails in Internet Explorer 6.

Any ideas?
Thanks
Jul 23 '05 #1
2 1487
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.
Jul 23 '05 #2

"Michael Winter" <M.******@blueyonder.co.invalid> ha scritto nel messaggio
news:opsfvao4fxx13kvk@atlantis...
On Thu, 14 Oct 2004 17:49:53 +0100, vastaso <va*****@hjjh.it> wrote:

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


Oh YES! It helps!!
Thank you very much
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: martin | last post by:
I needed a way to display calculated, multiple, changing values (numerical sums) as users interacted with the page, and do this without going back to the server to load the page again. What I...
3
by: Astra | last post by:
Hi All Could somebody confirm if and how I can change the TYPE of a textbox from PASSWORD to TEXT depending on whether a user checks a checkbox. In essence I have a login and password form and...
1
by: MickG | last post by:
I am trying to change the value of the variable "hard" according to which radio button is pressed and I am having no joy. Could anyone help me with this, the problematic section is marked with...
7
by: Stefan Finzel | last post by:
Hi, is there a way to change the display property on Windows Mobile 2003 SE Mobile/Pocket Internet Explorer? See following example. Please note: visibilty property has the same problem. Is...
5
by: cjl | last post by:
Hey all: This code: if (stealth) { document.searchme.query.type = 'password'; } else {
13
by: amykimber | last post by:
Hi all, I know I'm doign something really daft, but I can't get this to work... I have a form with a bunch of inputs called ship_owner - why the ? Because I'm submitting this page though php...
1
by: rbinington | last post by:
Hi, I am trying to write a DNN module that has the ability to insert articles into an article repository. I want the users to be able to move pages around and enter text into the FCKEditor. I...
1
by: peck2000 | last post by:
Related to my earleir post ... this is the same project to re-purpose the Classifieds application in BEGINNING ASP 3.0 (Wrox) to a comicbook database ... This is a brainteaser that should have...
8
by: mike_solomon | last post by:
I have a button <input type="submit" name="Delete" value="Delete"> This code can not be changed I want to use Javascript to change the type I tried:
1
by: sandeep kumar shah | last post by:
Hi, We have used a file uploading HTML tag in an HTML page. We need to customize the text displayed on the Button (which is by default “Browse…” for internet explorer). Below is the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.