Hi,
I have found this script that drags some text into an input field
[code=html]
<html>
<head>
<title>System Drag And Drop Example</title>
<script type=”text/javascript”>
function handleMouseMove(oEvent) {
if (oEvent.button == 1) {
oEvent.srcElement.dragDrop();
}
}
function handleDragDropEvent(oEvent) {
oEvent.dataTransfer.setData(“text”, “Paul”);
}
</script>
</head>
<body>
<p>Try dragging the red square into the textbox.</p>
<p><div style=”background-color: red; height: 100px; width: 100px”
onmousemove=”handleMouseMove(event)”
ondragstart=”handleDragDropEvent(event)”>Paul</div> </p>
<p><input type=”text” value=”” /></p>
</body>
</html>
what I want is a list of text and the user chooses what to drag into the text box.
I have tried this code below
[code=html]
<html>
<head>
<title>System Drag And Drop Example</title>
<script type=”text/javascript”>
function handleMouseMove(oEvent) {
if (oEvent.button == 1) {
oEvent.srcElement.dragDrop();
}
}
function handleDragDropEvent(oEvent, name) {
oEvent.dataTransfer.setData(“text”, name);
}
</script>
</head>
<body>
<p>Try dragging the red square into the textbox.</p>
<p><div style=”background-color: red; height: 100px; width: 100px”
onmousemove=”handleMouseMove(event)”
ondragstart=”handleDragDropEvent(event, “Paul”)”>Paul</div> </p>
<p><div style=”background-color: red; height: 100px; width: 100px”
onmousemove=”handleMouseMove(event)”
ondragstart=”handleDragDropEvent(event, “Ron”)”>Ron</div> </p>
<p><input type=”text” value=”” /></p>
</body>
</html>
The changes are the names that are being passes
Any ideas?
thanks in advance