Jquery Form Builder Help

Jquery Form Builder Help

Hi I am trying to create a form builder that is drag gable and sortablethe features I need are to highlight the drop zone once the control is on the area that is drop able.

To be able to set the required max length attributes and also to be able to portable I have it working in a crude way Except for the property inspector and was wanting advice or code samples.

In the below example I am using just li's which I am sure is not the way to go, as



  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4.  <meta charset="utf-8">
  5.  <title>jQuery UI Draggable + Sortable</title>
  6.  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
  7.  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  8.  <script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
  9.  <link rel="stylesheet" href="/resources/demos/style.css">
  10.  <style>
  11.  ul { list-style-type: none; margin: 0; padding: 0; margin-bottom: 10px; }
  12.  li { margin: 5px; padding: 5px; width: 150px; }
  13.  </style>
  14.  <script>
  15.  $(function() {
  16. $( "#sortable" ).sortable({
  17.  revert: true
  18. });
  19. $( "#draggable" ).draggable({
  20.  connectToSortable: "#sortable",
  21.  helper: "clone",
  22.  revert: "invalid"
  23. });
  24. $( "ul, li" ).disableSelection();
  25. $( "#draggable2" ).draggable({
  26.  connectToSortable: "#sortable",
  27.  helper: "clone",
  28.  revert: "invalid"
  29. });
  30. $( "ul, li" ).disableSelection();
  31.  });
  32.  </script>
  33. </head>
  34. <body>
  35.  
  36. <div style="float:left;">
  37. <ul>
  38.  <li id="draggable" class="ui-state-highlight"><input type="text"  id="test">Text Box</li>
  39. </ul>
  40. <ul> 
  41. <li id="draggable2" class="ui-state-highlight">Radio Button</li>
  42. </ul>
  43. </div>
  44. <div style="float:left;">
  45. <ul id="sortable">
  46.  <li class="ui-state-default">Item 1</li>
  47.  <li class="ui-state-default">Item 2</li>
  48.  <li class="ui-state-default">Item 3</li>
  49.  <li class="ui-state-default">Item 4</li>
  50.  <li class="ui-state-default">Item 5</li>
  51. </ul>
  52. </div>
  53.  
  54.  
  55. </body>
  56. </html>