EasyUI Forum
May 16, 2024, 01:49:42 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: create a ajax form to read data  (Read 11482 times)
fcodebue
Newbie
*
Posts: 5



View Profile WWW Email
« on: January 15, 2012, 09:38:59 PM »

I simply want to create a ajax form to read some data to edit/create and save.
I create two button in my grid toobar: edit and add.
Code:
    function add_it(){
      // url:'p_site/verbali_punti_create',
      formStatus= 'add';
$('#dlg').form({
  success:function(data){
  $.messager.alert('Info', data, 'info');
  }
});
      $('#dlg').dialog('open');
    }

    function edit_it(id){
      formStatus= 'edit';
      //url:'p_site/verbali_punti_update',
$('#dlg').form({
  success:function(data){
  $.messager.alert('Info', data, 'info');
  }
});
      $('#dlg').dialog('open');
    }


so these create a dialog where insert/edit data

Code:
<div id="dlg" class="easyui-dialog" closed="true" style="width:600px;height:250px;padding:10px 30px;"
title="punti verbali" buttons="#dlg-buttons">
<h2>Punto verbale</h2>
<form id="verbali_punti_form" method="post" action="p_site/verbali_punti_create">
    <table>
      <tr><td>
        <?php echo form_label('numero_punto','numero_punto'$attributes).form_input('numero_punto'$verbali_punti['numero_punto'], 'id="punti_numero_punto"'); ?>
      </td></tr>
      <tr><td>
        <?php echo form_label('descrizione','descrizione'$attributes).form_input('descrizione'$verbali_punti['descrizione'], 'id="punti_descrizione"'); ?>
      </td></tr>
      <tr><td>
        <?php 
        $dattributes
'class="date-pick dp-applied" id="data_consegna"';
        echo 
form_label('consegna','data_consegna'$attributes);
        echo 
form_input('data_consegna'unix_timestamp_to_human($verbali_punti['data_consegna']), $dattributes); ?>

      </td></tr>
      <tr><td>
        <?php 
        $dattributes
'class="date-pick dp-applied" id="data_proroga"';
        echo 
form_label('data proroga','data_proroga'$attributes);
        echo 
form_input('data_proroga'unix_timestamp_to_human($verbali_punti['data_proroga']), $dattributes); ?>

      </td></tr>
    </table>
</form>
</div>
<div id="dlg-buttons">
<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="verbali_punti_save();">Submit</a>
<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">Cancel</a>
</div>

1. I CAN'T save data of the dialog and when I inspect code with firebug I DON'T see form into dialog!
Logged

Codebue Fabio
---------------------
P-Soft
pacific202
Newbie
*
Posts: 35


View Profile
« Reply #1 on: January 16, 2012, 02:01:46 PM »

Could you also post your form code?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!