Created
September 17, 2014 15:12
-
-
Save anonymous/d07e420e11567c0c5a87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function move(element,to){ | |
trying = element+to; | |
if (trying==0) { | |
to = count; | |
} else { | |
if (trying==count) { | |
to = 1; | |
} else { | |
to = trying; | |
} | |
} | |
fields = new Array("","name","desc","id","delete","clazz","client",""); | |
values = new Array(fields.length); | |
fieldcount = fields.length -1; // I start at 1 | |
// Save away | |
for(i=1;i<fieldcount;i++) { | |
values[i] = document.forms[0].elements[fields[i]+element].value ; | |
} | |
// Switch 1 | |
for(i=1;i<fieldcount;i++) { | |
document.forms[0].elements[fields[i]+element].value = document.forms[0].elements[fields[i]+to].value; | |
} | |
// Switch 2 | |
for(i=1;i<fieldcount;i++) { | |
document.forms[0].elements[fields[i]+to].value = values[i]; | |
} | |
} |
tjhorner
commented
Sep 18, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment