Hi everybody,
I have this expand/contract thing, whereby a button is situated below a label "Advanced Features".
And so when the user clicks on "Advanced Features", the button will drop below the whole expansion. The button should be situated BEFORE the label before clicking onto "Advanced Features".
Any ideas on how I can do this?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script language = "javascript" type = "text/javascript">
var collapsable_parent_name = "collapseExpand";
var collapsable_parent_type = "div";
var collapsable_child_type = "div";
var collapsable_expand = "Advanced Features";
var collapsable_shrink = "Simple Features";
init = function()
{
if(document.getElementById && document.createTextNode)
{
var entries = document.getElementsByTagName(collapsable_parent_type);
for(i = 0; i < entries.length; i++)
if (entries[i].className == collapsable_parent_name)
assignCollapse(entries[i]);
}
}
assignCollapse = function (div)
{
var button = document.createElement("collapse_add_adv_features");
button.style.cursor = "pointer";
button.setAttribute("expand", collapsable_expand);
button.setAttribute("shrink", collapsable_shrink);
button.setAttribute("state", -1);
div.insertBefore(button, div.getElementsByTagName(collapsable_child_type)[0]);
button.onclick=function()
{
var state = -(1*this.getAttribute("state"));
this.setAttribute("state", state);
this.parentNode.getElementsByTagName(collapsable_child_type)[0].style.display=state==1?'none':'block';
this.innerHTML = this.getAttribute(state==1?"expand":"shrink");
};
button.onclick();
}
window.onload = init;
</script>
</head>
<body>
<table>
<label>
*First Name:</label>
<input id="Text16" type="text" name="First Name" onkeydown="return noSpace(event)" />
<br />
<br />
<label>
*Last Name:</label>
<input id="Text17" type="text" name="Last Name" onkeydown="return noSpace(event)" /><br />
<br />
<div class="collapseExpand">
<div>
<br />
<ul id="mailboxTabs" class="shadetabs">
<li><a class="selected" href="#" rel="mailbox1">1</a></li>
<li><a class="" href="#" rel="mailbox2">2</a></li>
<li><a class="" href="#" rel="mailbox3">3</a></li>
</ul>
<div class="contentBox">
<div style="display: block;" id="mailbox1" class="tabcontent">
</div>
<div style="display: none;" id="mailbox2" class="tabcontent">
</div>
<div style="display: none;" id="mailbox3" class="tabcontent">
</div>
<div style="display: none;" id="mailbox4" class="tabcontent">
</form>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var switchMBTabs=new ddtabcontent("mailboxTabs")
switchMBTabs.setpersist(true)
switchMBTabs.setselectedClassTarget("link") //"link" or "linkparent"
switchMBTabs.init()
</script>
<input id="Submit17" type="submit" value="Submit" onclick="return check()"/>
</td>
</tr>
</table>
</body>
</html>