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:
- <script type="text/javascript" src="view/javascript/jquery/jquery-1.5.min.js"></script>
- <script type="text/javascript" src="view/javascript/jquery/ui/ui.core.js"></script>
- <script type="text/javascript" src="view/javascript/jquery/ui/ui.dialog.js"></script>
- <script type="text/javascript" src="view/javascript/jquery/ui/ui.resizable.js"></script>
- <script type="text/javascript" src="view/javascript/jquery/ui/ui.draggable.js"></script>
- <script type="text/javascript">
- $(function(){
- $("#form_new_consigna").dialog({
- autoOpen: false,
- height: 300,
- width: 350,
- modal: true,
- buttons: {
- "Save" : function() {
- $("#form_consigna").submit();
- },
- "Cancel" : function() {
- $(this).dialog("close");
- }
- }
- });
- $("#new_consigna").click(function(){
- $("#form_new_consigna").dialog("open");
- });
- });
- </script>
And this is the HTML code:
<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>
<label>
<span>Fecha: </span>
<input type="text" name="consigna_date" id="consigna_date" />
</label>
</div>
</form>
</div>
- <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?