Ragazzi, ho modificato uno script basato su scriptaculous, quello relativo al drag.
In pratica ho tre box: i primi due (thelist1 e thelist2) con alcune voci, il terzo vuoto. Trascinando i campi dai 2 box al terzo (thelist3), e cliccando su ""CALCOLA", si apre una finestra di alert, con la seguente frase:
thelist3[]=1&thelist3[]=2&thelist3[]=3
ovvero ho spostato nel terzo box, in ordine, la voce 1, la voce 2 e la voce 3 dal primo box.
Fin qui tutto bene, solo che io vorrei che cliccando sul link "CALCOLA", mi rimandi all'url:
risultati.asp?id=1,2,3
in modo che in questa pagina io possa fare uno split e ricavarne i singoli id.
Non so se avrei dovuto postare questa domanda nella sezione ASP. Vi prego di aiutarmi che sono rimasto bloccato.
Grazie in anticipo
<!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" xml:lang="en" lang="en">
<head>
<title>script.aculo.us sortable functional test file</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="prototype.js" type="text/javascript"></script>
<script src="scriptaculous.js" type="text/javascript"></script>
<script src="unittest.js" type="text/javascript"></script>
<link rel="stylesheet" href="test.css" type="text/css" />
<style type="text/css" media="screen">
ul {
height: 100px;
border:1px dotted #888;
width: 200px;
}
</style>
</head>
<body>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<ul id="thelist1">
<%
sql = "SELECT * FROM dati order by id asc"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql, conn, 3,3
do while not(rs.eof)
%>
<li id="thelist1_<%=rs("id")%>"><%=RS("nome")%>
<%
rs.movenext
loop
rs.Close
set rs = Nothing
%>[/list]
</td>
<td>
<ul id="thelist2">
<li id="thelist2_1">Museo
<li id="thelist2_2">Ristorante
<li id="thelist2_3">Cinema[/list]</td>
<td>
<ul id="thelist3">[/list]
</td>
</tr>
</table>
<script type="text/javascript" language="javascript" charset="utf-8">
// <![CDATA[
Sortable.create('thelist1',{containment:['thelist1','thelist2','thelist3'], dropOnEmpty:true});
Sortable.create('thelist2',{containment:['thelist1','thelist2','thelist3'], dropOnEmpty:true});
Sortable.create('thelist3',{containment:['thelist1','thelist2','thelist3'], dropOnEmpty:true});
// ]]>
</script>
Calcola
<div id="debug"></div>
</body>
</html>

Rispondi quotando