<%
' IIf, can't live without it..
Function IIf(Expression, TruePart, FalsePart)
If Expression Then IIf = TruePart Else IIf = FalsePart
End Function
select case request("task")
case "changesortorder"
fields = split(request("sortorder"), ",")
for each field in fields
if len(field) > 0 then
nIndex = nIndex + 1
sql = "UPPDATERA DATABASEN MED DE NYA SORTINDEX HÄR"
conn.Execute sql
end if
next
End Select
%>
<script type="text/javascript">
function optionswap( obj, i1, i2 )
{
if( typeof( obj ) != "object" )
return false;
if ( obj.selectedIndex == -1 )
return false;
if ( obj.length == 0 || i2 == obj.length || i2 == -1 )
return false;
var text1 = obj.options[ i1 ].text;
var value1 = obj.options[ i1 ].value;
var text2 = obj.options[ i2 ].text;
var value2 = obj.options[ i2 ].value;
obj.options[ i1 ].text = text2;
obj.options[ i1 ].value = value2;
obj.options[ i2 ].text = text1;
obj.options[ i2 ].value = value1;
obj.selectedIndex = i2;
}
function saveorder ( obj )
{
if( typeof( obj ) != "object" )
return false;
document.forms[0].sortorder.value = '';
for (i=0;i
document.forms[0].sortorder.value += obj.options[ i ].value + ",";
}
document.forms[0].task.value = 'changesortorder';
document.forms[0].submit();
}
</script>