jquery disable text box created after drag and drop

Posted by user1736989 on Stack Overflow See other posts from Stack Overflow or by user1736989
Published on 2012-10-19T04:21:03Z Indexed on 2012/10/19 5:01 UTC
Read the original article Hit count: 132

Filed under:
|
|
|

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);
     }
}
  1. 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
  2. Is there any easy way in which i can include this html from some other page?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about dynamic