Display/Hide Sections on the web - Javascript

Sub-form - I have a button with the following onClick javascript code:

hideviewsection(‘section1’);

Directly below that button I have the following pass-thru HTML code: (this part works)

Directly below that I have a table with pass-thru HTML and fields…Then below the last row, I have pass-thru HTML

On the mainform (which contains the sub-form), I have a JSHeader of:

function hideviewsection(divname){

var s1 = form.document.getElementById(‘’ + divname + ‘’);

if(s1.style.display == “none”){

s1[1].style.display = “inline”;

}else{

s1[1].style.display = “none”;

}

}

My problems are, the screen is refreshing/reloading similar to the Lotus Notes web refresh(screen flicker) AND the contents of the

tag is not loading (‘inline’)…

Can anyone notice any errors in the code…I am using IE and it runs with no errors (bottom left corner)…

Thanks in advance for any responses…

Subject: Display/Hide Sections on the web - Javascript

You are setting s1 incorrectly and referring to s1[1] instead of s1

Try the following.

function hideviewsection(divname){

var s1 = document.getElementById(divname);

if(s1.style.display == “none”){

s1.style.display = “inline”;

}else{

s1.style.display = “none”;

}

}

Subject: RE: Display/Hide Sections on the web - Javascript

Worked like a charm…Thank you much