View Full Version : I want to Resize frames on a button click

10-12-2005, 05:54 PM
I tried this:

<INPUT TYPE="button" VALUE="Viewer" onClick="parent.setAttribute('cols', '963,*')">

and it's just not working.... what am i doing wrong? or are there any other methods that will work?

10-12-2005, 06:26 PM

<INPUT TYPE="button" VALUE="Viewer" onClick="parent.document.getElementById('theframe').cols='963,*'">
Give the frameset that you want to control an id="theframe"

10-12-2005, 06:43 PM
thankx sooo much... it worked

10-13-2005, 08:49 PM
FYI for others that may experience this problem... I found out that IE doesn't like setAttribute() to reset an existing attribute (or to set an attribute that IE defines by default (such as 'id'!). I had a similar problem when I was creating elements using DOM and trying to setAttribute('id', 'newIdName') and devised a work-around function to handle this situation:

function attributeSet(elem, attrb, setting)
var elemAttrb = elem.getAttributeNode(attrb);
if (elemAttrb)
} else {
elem.setAttribute(attrb, setting);