nadia
08-06-2003, 04:23 AM
Hi Guys..
Do u have any ideas on how to do the function move column which is similar to yahoo.com>>layout personalization..??? Any ideas,guys..???
Thanks in advance.
pls icq me de ans>>>172989538
or email me... :confused:
Take a look at http://www.infinitypages.com/research/iframecustomscroller.htm
jrthor2
08-06-2003, 08:34 AM
This goes in the Head section of your page:
<script language=javascript>
<!--
function moveModule(o_col, d_col)
{
if (document.fm[d_col].length != 5) { //only allow 5 selections
o_sl = document.fm[o_col].selectedIndex;
d_sl = document.fm[d_col].length;
if (o_sl != -1 && document.fm[o_col].options[o_sl].value > "") {
oText = document.fm[o_col].options[o_sl].text;
oValue = document.fm[o_col].options[o_sl].value;
document.fm[o_col].options[o_sl] = null;
document.fm[d_col].options[d_sl] = new Option (oText, oValue, false, false);
} else {
alert("Please select an item first");
}
} else {
alert("You may only select 5 drugs to compare")
exit;
}
}
function orderModule(down, col)
{
sl = document.fm[col].selectedIndex;
if (sl != -1 && document.fm[col].options[sl].value > "") {
oText = document.fm[col].options[sl].text;
oValue = document.fm[col].options[sl].value;
if (document.fm[col].options[sl].value > "" && sl > 0 && down == 0) {
document.fm[col].options[sl].text = document.fm[col].options[sl-1].text;
document.fm[col].options[sl].value = document.fm[col].options[sl-1].value;
document.fm[col].options[sl-1].text = oText;
document.fm[col].options[sl-1].value = oValue;
document.fm[col].selectedIndex--;
} else if (sl < document.fm[col].length-1 && document.fm[col].options[sl+1].value > "" && down == 1) {
document.fm[col].options[sl].text = document.fm[col].options[sl+1].text;
document.fm[col].options[sl].value = document.fm[col].options[sl+1].value;
document.fm[col].options[sl+1].text = oText;
document.fm[col].options[sl+1].value = oValue;
document.fm[col].selectedIndex++;
}
} else {
alert("Please select an item first");
}
}
function xMod(col)
{
req = "";
sl = document.fm[col].selectedIndex;
if (sl != -1 && document.fm[col].options[sl].value > "") {
if (req.indexOf(document.fm[col].options[sl].value) > -1) {
alert ("You may not delete a required corporate module.");
} else {
if (confirm("This will delete the selected item.")) {
if (document.fm[col].options[sl].value!=".none") {
if (document.fm[col].length==1) {
document.fm[col].options[0].text="";
document.fm[col].options[0].value=".none";
} else {
document.fm[col].options[sl]=null;
}
} else {
alert("Please select an item first");
}
}
}
}
}
function doSub()
{
layout = "dgsel";
for (i=0; i < layout.length; i++) {
if (layout.substr(i,1) == 'N' || layout.substr(i,1) == 'W') {
col = layout.substr(i,2);
document.fm[col + "_lst"].value = makeList(col);
}
}
return true;
}
function makeList(col)
{
val = "";
for (j=0; j<document.fm[col].length; j++) {
if (val > "") { val += ","; }
if (document.fm[col].options[j].value > "") val += document.fm[col].options[j].value;
}
return val;
}
function sub_layout(layout) {
document.fm['.commit'][0].value="";
document.fm['.layout'].value=layout;
doSub();
document.fm.submit();
}
// -->
</script>
This is what your link ro move the item to the other column would look like:
<a href="javascript:moveModule('dglst','dgsel[]');" onFocus="if(this.blur)this.blur()">