Forum Moderators: open
I'm working on a JavaScript HTML editor for users to style their postings. It uses two frames: the top frame is the editor and the bottom is the viewer.
So, in order to fit all the options neatly in the top frame, I am using DHTML to show/hide certain parts of the form at different times. You start with just one dropdown to select a type of element(paragraph, heading, etc.). Then, you get all the style options(margin, font, border, background, etc.). And finally, you can click a button to choose your colors(font,bg,border).
That's where the problem is. In opera, once the main chunk of the form(style options) is set to display: none;, all the values in that section are lost to the script.
The only solution I can think of is to add a hidden field for each field that is in the middle section and make sure they are outside of the sections that show/hide. What a hack though :(
Anyony have any other ideas? Thanks!
Thanks Blobfisk/DrDoc, as well
On top of that, it now breaks the HTML of the page. Somehow it add broken tags at the end of the file(outside the js)
Like this:
</form>
</body>
</html>iv>
</form>
</body>
</html>br />
Removing the closing slashes on my input tags and break tags solves that. I'm using XHTML 1.0 trans doctype. If I put my original toggle/display coding back in, it doesn't choke on the closing slashes. Weird!
if(getObj("coloring").style.display == "block") getObj("tools").style.display = "block";
...read all fields now...
if(getObj("coloring").style.display == "block") getObj("tools").style.display = "none";
It seems to work well but have yet to test in other browsers. Thanks again for all the good suggestions.
Birdman