JqueryUI: a link and a modal form, how can show the form above the page where the link is?

JqueryUI: a link and a modal form, how can show the form above the page where the link is?

Hi,

i have link that shows a modal form, but it shows the dialog in a new page..

I want to show the modal form above the page where is the link.

What should i do?


This is the link:

  1.     <a href="/frontend_dev.php/mensaje_nuevo?receptor=1&amp;tipo=0&amp;estado=0">Enviar mensaje</a>

And this shows the modal form:


  1.     <script type="text/javascript">
  2.      $(function() {
  3.       $("#dialog").dialog({ height: 223, width: 373, top: 160, left: 439, modal: true });
  4.      });
  5.      </script>
  6.    
  1.         <form id="dialog" action="<?php echo url_for('mensaje/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
  2.     
  3.     <table>
  4.        
  5.      <?php
  6.      // muestra el formulario
  7.      echo $form
  8.      ?>
  9.      <tr>
  10.          <td>&nbsp;</td>
  11.       <td>
  12.           <input type="submit" value="Enviar" />
  13.              <?php echo link_to('Cancelar', $sf_request->getReferer()) ?>
  14.          </td>
  15.         </tr>
  16.     </table>
  17. </form>


Regards

Javi