Monday, 19 August 2013

Drag n Drop from a DropDownList to a TextBox

Drag n Drop from a DropDownList to a TextBox

I want to implement Drag n' Drop Functionality in from a DropDownList to a
TextBox in ASP .NET.
I will select and drag 1 item from a DropDownList and drop it on a
TextBox. I have tried using the jQuery plugin but to no avail.
Please see my markup below:
<script type="text/javascript" src="../Scripts/jquery-1.9.1.js"></script>
<script src="../Scripts/ui/jquery-ui.custom.js"
type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
DropDown();
StyleButton();
$('.dragndrop').draggable();
$('#<%=TextBox1.ClientID %>').droppable({
drop: function (ev, ui) {
ui.draggable.appendTo(this);
}
});
});
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" align="left" style="width:200px;">
<asp:DropDownList ID="DropDownList1"
runat="server" CssClass="dragndrop">
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"
TextMode="MultiLine" Height="80px"
Width="250px"></asp:TextBox>
</td>
</tr>
</table>
Please what I'm I doing wrong?

No comments:

Post a Comment