Hello all I have a Drag and Drop I am draging a <a href> in to a group of
<input>'s all named the same thing, I have tryed to rename them name=1
name=2 ect... but with no luck, I can get it drop in to the top position and
in all the position but I want it to drop in to the posistion that I drag it
to any help on this Would be great I have been banging my head againt a wall
for a couple of days now. Here is the Code.
Thanks Tim
<%
Option Explicit
Dim Connection, sql, objRS, objRSList, i, RS, strCon
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open "DSN=SBDC"
Sql = "SELECT DISTINCT OwnerTable FROM FormDic WHERE Qform = '1'"
SET objRS = Connection.Execute(Sql)
strCon = "DSN=xxxx"
i = 0
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<script language="javascript" src="foldernav.js">
</SCRIPT>
</HEAD>
<BODY>
<table width=800 border=1>
<tr><td>
<table border=1>
<tr><td>
<%while not objRS.EOF%>
<%i = i + 1%>
<div ID="m<%=i%>Parent" class="parent">
<a name="m<%=i%>a" href="#" onClick="FolderExpand('m<%=i%>')">
<img name="m<%=i%>Tree" src="images/white.gif" align="absmiddle"
border="0">
<img name="m<%=i%>Folder" src="images/foldericon.gif" class="icon"
align="absmiddle" border="0">
<font color="black" size="2"
class="item"><%=Trim(objRS("OwnerTable"))%></font></a>
</div>
<div ID="m<%=i%>Child" CLASS="child">
<%SET objRSList = Connection.Execute("SELECT Qname,ID FROM FormDic WHERE
OwnerTable = '" & objRS("OwnerTable") & "' AND Qform = '1'")%>
<%while not objRSList.EOF%>
<img src="images/white.gif" align="absmiddle">
<img src="images/T.gif" align="absmiddle">
<img src="images/htmlicon.gif" align="absmiddle" class="icon">
<a class="item" href="#"
onDragStart="startDrag('<%=Trim(objRSList("Qname"))%>')"><%=Trim(objRSList("
Qname"))%></a><br>
<%objRSList.MoveNext%>
<%Wend%>
</div>
<%objRS.MoveNext%>
<%Wend%>
</td></tr>
</table>
</td><td>
<table width=500 border=1>
<form name="inputForm">
<tr><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td></tr>
<tr><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td></tr>
<tr><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td></tr>
<tr><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td></tr>
<tr><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td></tr>
<tr><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td></tr>
<tr><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td></tr>
<tr><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td></tr>
<tr><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td></tr>
<tr><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td><td>
Question: <input name="target" value="" ondragenter="showDragCursor()"
ondragover="showDragCursor()" ondrop="drop()">
</td></tr>
<tr><td align=center><input Type=Submit value=Submit></td><td
align=center><input Type=Reset></td></tr>
</form>
</table>
</td></tr>
</table>
</BODY>
</HTML>
document.onmouseover = mOver ;
document.onmouseout = mOut ;
function mOver() {
var eSrc = window.event.srcElement ;
if (eSrc.className == "item") {
window.event.srcElement.className = "highlight";
}
}
function mOut() {
var eSrc = window.event.srcElement ;
if (eSrc.className == "highlight") {
window.event.srcElement.className = "item";
}
}
var bV=parseInt(navigator.appVersion);
NS4=(document.layers) ? true : false;
IE4=((document.all)&&(bV>=4))?true:false;
ver4 = (NS4 || IE4) ? true : false;
isExpanded = false;
function getIndex($1) {
ind = null;
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id == $1) {
ind = i;
break;
}
}
return ind;
}
function arrange() {
nextY = document.layers[firstInd].pageY +
document.layers[firstInd].document.height;
for (i=firstInd+1; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.visibility != "hide") {
whichEl.pageY = nextY;
nextY += whichEl.document.height;
}
}
}
function FolderInit(){
if (NS4) {
firstEl = "mParent";
firstInd = getIndex(firstEl);
showAll();
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
}
arrange();
}
else {
tempColl = document.all.tags("DIV");
for (i=0; i<tempColl.length; i++) {
if (tempColl(i).className == "child") tempColl(i).style.display = "none";
}
}
}
function FolderExpand($1,$2) {
if (!ver4) return;
if (IE4) { ExpandIE($1,$2) }
else { ExpandNS($1,$2) }
}
function ExpandIE($1,$2) {
Expanda = eval($1 + "a");
Expanda.blur()
ExpandChild = eval($1 + "Child");
if ($2 != "top") {
ExpandTree = eval($1 + "Tree");
ExpandFolder = eval($1 + "Folder");
}
if (ExpandChild.style.display == "none") {
ExpandChild.style.display = "block";
if ($2 != "top") {
if ($2 == "last") { ExpandTree.src = "images/white.gif"; }
else { ExpandTree.src = "images/white.gif"; }
ExpandFolder.src = "images/openfoldericon.gif";
}
else { mTree.src = "images/white.gif"; }
}
else {
ExpandChild.style.display = "none";
if ($2 != "top") {
if ($2 == "last") { ExpandTree.src = "images/white.gif"; }
else { ExpandTree.src = "images/white.gif"; }
ExpandFolder.src = "images/foldericon.gif";
}
else { mTree.src = "images/white.gif"; }
}
}
function ExpandNS($1,$2) {
ExpandChild = eval("document." + $1 + "Child")
if ($2 != "top") {
ExpandTree = eval("document." + $1 + "Parent.document." + $1 + "Tree")
ExpandFolder = eval("document." + $1 + "Parent.document." + $1 + "Folder")
}
if (ExpandChild.visibility == "hide") {
ExpandChild.visibility = "show";
if ($2 != "top") {
if ($2 == "last") { ExpandTree.src = "images/white.gif"; }
else { ExpandTree.src = "images/white.gif"; }
ExpandFolder.src = "images/openfoldericon.gif";
}
else { mTree.src = "images/white.gif"; }
}
else {
ExpandChild.visibility = "hide";
if ($2 != "top") {
if ($2 == "last") { ExpandTree.src = "images/white.gif"; }
else { ExpandTree.src = "images/white.gif"; }
ExpandFolder.src = "images/foldericon.gif";
}
else { mTree.src = "images/white.gif"; }
}
arrange();
}
function showAll() {
for (i=firstInd; i<document.layers.length; i++) {
whichEl = document.layers[i];
whichEl.visibility = "show";
}
}
with (document) {
write("<STYLE TYPE='text/css'>");
if (NS4) {
write(".parent { color: black; font-size:9pt; line-height:0pt;
color:black; text-decoration:none; margin-top: 0px; margin-bottom: 0px;
position:absolute; visibility:hidden }");
write(".child { text-decoration:none; font-size:9pt; line-height:15pt;
position:absolute }");
write(".item { color: black; text-decoration:none }");
write(".highlight { color: blue; text-decoration:none }");
}
else {
write(".parent { font: 12px/13px; Times; text-decoration: none; color:
black }");
write(".child { font:12px/13px Times; display:none }");
write(".item { color: black; text-decoration:none; cursor: hand
}");
write(".highlight { color: blue; text-decoration:none }");
write(".icon { margin-right: 5 }")
}
write("</STYLE>");
}
function startDrag(info) {
window.event.dataTransfer.setData("Text", info);
window.event.dataTransfer.effectAllowed = "copy";
}
function drop() {
window.event.returnValue = false;
window.event.dataTransfer.dropEffect = "copy";
var form = window.document.forms[0]
for (var i = 0; i < form.elements.length; i ++) {
if (form.elements[i].type == "text"){
form.elements[i].value = window.event.dataTransfer.getData("Text");
}
}
}
function showDragCursor() {
window.event.returnValue = false;
window.event.dataTransfer.dropEffect = "copy";
}
onload = FolderInit;