Why the dialog is not showed?

Why the dialog is not showed?

Hi every:
I'm trying to setup a modal dialog on my site. This is the code I'm using:

  1. <script type="text/javascript" src="view/javascript/jquery/jquery-1.5.min.js"></script>
  2. <script type="text/javascript" src="view/javascript/jquery/ui/ui.core.js"></script>
  3. <script type="text/javascript" src="view/javascript/jquery/ui/ui.dialog.js"></script>
  4. <script type="text/javascript" src="view/javascript/jquery/ui/ui.resizable.js"></script>
  5. <script type="text/javascript" src="view/javascript/jquery/ui/ui.draggable.js"></script>
  6. <script type="text/javascript">
  7.       $(function(){
  8.       $("#form_new_consigna").dialog({
  9.       autoOpen: false,
  10. height: 300,
  11. width: 350,
  12. modal: true,
  13. buttons: {
  14.       "Save" : function() {
  15. $("#form_consigna").submit();
  16. },
  17. "Cancel" : function() {
  18. $(this).dialog("close");
  19. }
  20. }
  21. });
  22. $("#new_consigna").click(function(){
  23. $("#form_new_consigna").dialog("open");
  24. });
  25. });
  26. </script>

And this is the HTML code:


  1. <div id="form_new_consigna" style="display: none" title="Add new one">
          <form action="save_data.php" method="post" enctype="multipart/form-data" id="form_consigna">
                <div class="form_box">
          <label>
          <span>Código: </span>
    <input type="text" name="consigna_code" id="consigna_code" size="25" />
    </label>






  2.  <label>
          <span>Fecha: </span>
    <input type="text" name="consigna_date" id="consigna_date" />
    </label>
    </div>
    </form>
    </div>






  3. <div> Here goes another <form></form></div>

But it doesn't work because the form is sended and I don't know the cause. Can any help me?