Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q457 Is it possible to make select object form hidden?

irt.org | Knowledge Base | DHTML | Q457 [ previous next ]

Q457 Is it possible to make select object form hidden?

Only in Netscape Navigator 4 and/or Internet Explorer 4 by the clever use of DHTML.

<SCRIPT LANGUAGE="JavaScript"><!--
var hidden = false;
var mytext = '<FORM><SELECT><OPTION>This is option 1<OPTION>This is option 2<OPTION>This is option 3<OPTION>This is option 4<\/SELECT><\/FORM>';
function changeit() {
    if (hidden) {
        if (document.layers) {
            document.layers['GenericID'].document.open();
            document.layers['GenericID'].document.writeln(mytext);
            document.layers['GenericID'].document.close();
        }
        else if (document.all)
            document.all("GenericID").innerHTML= mytext;
    }
    else {
        if (document.layers) {
            document.layers['GenericID'].document.open();
            document.layers['GenericID'].document.writeln('');
            document.layers['GenericID'].document.close();
        }
        else if (document.all)
            document.all("GenericID").innerHTML= '';
    }
    hidden = !hidden;
}
//--></SCRIPT>

<DIV ID="GenericID" STYLE="position: absolute">
<SCRIPT LANGUAGE="JavaScript"><!--
document.write(mytext);
//--></SCRIPT>
</DIV>

<BR><BR><FORM><INPUT TYPE="BUTTON" VALUE="Click Me" onClick="changeit()"></FORM>

Feedback on 'Q457 Is it possible to make select object form hidden?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.