jquery disable text box created after drag and drop
- by user1736989
I have two div one for tools where to drag and one for dropping in.
html is
<div id="popular">
<ul>
<li class="dragfield" id="textfield">Text field</li>
<li class="dragfield"id="textarea">Text area</li>
<li class="dragfield"id="emailfield">email field</li>
<li class="dragfield"id="dropdownselection">dropdown selection</li>
<li class="dragfield"id="checkboxes">checkboxes</li>
<li class="dragfield"id="multiplechoicecheckboxes">multiple choice checkboxes</li>
</ul>
</div>
<div id="editable">
<p>hii</p>
</div>
and here is javascript for droppable
$(function() {
$('.dragfield').draggable();
$( "#editable" ).droppable({
drop: handletextDrop
});
});
function handletextDrop( event, ui ) {
var id = ui.draggable.attr("id");
if(id=="textfield") {
var $Div = $('<div id="TextBoxDiv"></div>');
$Div.append('<label>Textbox</label>' + '<input type="text" name="textbox" id="textbox" value="" />');
$('#editable').append($Div);
}
}
I want to make this textbox which is being created to remain disabled.javascript applying to id of these div e.g. #textbox etc. not working
Is there any easy way in which i can include this html from some other page?