E
Erwin Moller
Hi group,
I have this obscure problem that really needs to be fixed, but I am out of
ideas.
Because the original script is very big, I'll try to summarize its
functionality.
Setup:
- many form-elements that will 'activate' a part of the form based on the
selection made.
eg: A SELECT that will display a different part of the form depending on the
selection made.
- I implemented this by creating div's with an unique id.
They are standard off, as in:
<div id="option34" style="display:none">
Your name: <input type="text" name="firstname">
<br>
Your age: <input type="text" name="age">
</div>
<div id="option35" style="display:none">
Question bla: <input type="text" name="q33">
<br>
Question blabla: <input type="text" name="q56">
</div>
etc.
- The change in the selection in the SELECT will fire a JS function that
will make:
1) all div's that belong to other selections invisible by stetting their
var myDiv = document.getElementById("option34");
myDiv.style.display='none';
2) all div's belonging to my desired part visible by:
var myDiv = document.getElementById("option35");
myDiv.style.display='block';
---------------
This works fine.
I even passed the validation at validator.w3c.org
My doctype is 'loose.dtd' (please don't make me type the whole thingy.)
My problem:
Sometimes IE5.5 and 6.0 don't do it right.
I do not get a JS-error or something, but after I made some div's invisible
and others visible, IE leave 'grey area's' behind.
Sometimes IE leaves pieces of the old form (now display='none') behind, and
it looks like it is indeed just a piece of the old screen because I cannot
'use' the elements, like using a formelement type="text".
(This never happens in Firefox.)
Does anybody know how I solve this?
Is IE buggy somehow with div's that are made visible and invisible?
Can I tell IE to render right somehow?
Is my approach wrong?
Thanks for your time.
Regards,
Erwin Moller
I have this obscure problem that really needs to be fixed, but I am out of
ideas.
Because the original script is very big, I'll try to summarize its
functionality.
Setup:
- many form-elements that will 'activate' a part of the form based on the
selection made.
eg: A SELECT that will display a different part of the form depending on the
selection made.
- I implemented this by creating div's with an unique id.
They are standard off, as in:
<div id="option34" style="display:none">
Your name: <input type="text" name="firstname">
<br>
Your age: <input type="text" name="age">
</div>
<div id="option35" style="display:none">
Question bla: <input type="text" name="q33">
<br>
Question blabla: <input type="text" name="q56">
</div>
etc.
- The change in the selection in the SELECT will fire a JS function that
will make:
1) all div's that belong to other selections invisible by stetting their
var myDiv = document.getElementById("option34");
myDiv.style.display='none';
2) all div's belonging to my desired part visible by:
var myDiv = document.getElementById("option35");
myDiv.style.display='block';
---------------
This works fine.
I even passed the validation at validator.w3c.org
My doctype is 'loose.dtd' (please don't make me type the whole thingy.)
My problem:
Sometimes IE5.5 and 6.0 don't do it right.
I do not get a JS-error or something, but after I made some div's invisible
and others visible, IE leave 'grey area's' behind.
Sometimes IE leaves pieces of the old form (now display='none') behind, and
it looks like it is indeed just a piece of the old screen because I cannot
'use' the elements, like using a formelement type="text".
(This never happens in Firefox.)
Does anybody know how I solve this?
Is IE buggy somehow with div's that are made visible and invisible?
Can I tell IE to render right somehow?
Is my approach wrong?
Thanks for your time.
Regards,
Erwin Moller