JQuery ui modal, pass a variable in a form without ajax

Hi, I am trying to post some data in php form using jQuery modal window

My js

    $( "#dialog-form" ).dialog({
        autoOpen: false,
        height: 500,
        width: 650,
        modal: true,

        buttons: {
            Envoyer: function() {
                 $('form#leaveReq').submit();

             return true;

            },
            Ok: function() {
                $( this ).dialog( "close" );
            }
        }
    });

My html

My html and php (I use Code Igniter)

      <div id="dialog-form" title="Create new user">
     <?php $attributes = array('id' => 'leaveReq');
  echo form_open('school/parents/addevent', $attributes); ?>        
<p class="validateTips">Veillez remplire tous les champs</p> <br/> 


   <fieldset>
    <label for="name"><b>Date de l'évènement</b> </label> <br/> 
    <select id="message">
          <option>Volvo</option>
            <option>Saab</option>
            <option>Mercedes</option>
            <option>Audi</option>
           </select>        
    <label for="email">Nature du probleme</label> <br/>
        <select>
       <?php 
    foreach ($behaviours as $item):?>           
  <option><?=$item['name'];?></option>  

             

            Description du problmeme
             At W3Schools, you will find all the web building tutorials you need, from
              

     echo $text = $this->input->post('text');
 echo $message = $this->input->post('message');

nothing works

+3
source share
3 answers

find what @BrandonS said about your names

You NEED to give your modal to your form. try using this:

open: function (type, data) {
            // include modal into form
            $(this).parent().appendTo($("form:first"));
        },
0
source
  • Do it with ajax. This is easy to do in the encoder.

  • (+ ) iframe iframe jquery-UI. , , ( ajax);

0

, , , , form helper.

, , :

  • "name", post , . message .
  • ,

, , , , HTML-, , .

0

All Articles