doulianqi3870 2015-08-26 06:04
浏览 13

再次显示已在PHP中打开以进行验证的模式对话框

I have a PHP page for insert, update and delete in which a pop up for edit is shown as follows

enter image description here

The pop is shown in jquery as follows when the edit button is clicked in the table in background of image shown according to the id:

 $('.edit').live('click',function(){
    var id=$(this).attr('data-id');
    params={};
    params.id=id;
    params.action="editClient";
    $('#popupbox').load('chapter_manager.php', params,function(){
        $('#block').show();
        $('#popupbox').show();
           $(document).ajaxComplete(function(){
    $("#wait").css("display", "none");
});
    })

I need validation for the two input boxes. With jquery it works fine .

I need to perform server side validation .

The problem is that the page gets relaoded after the button click and hence the pop is not shown again after the server side validation.

I tried ajax but not working. Any idea how should I show the pop up again?

Also I want to know whether I need to perform PHP server side validation when already I have done validation in jquery?

I am using a page template in the modal pop up with the from submit and submit button as follows which is different from the page which is seen in the background.

 <form name ="client" id="client" method="POST" action="chapter_manager.php"><div style="display: block; position:relative;" class="modal">
    <div class="modal-dialog" style="width:100%; margin:0px 0px 0px 0px;">
      <div class="modal-content">
        <div class="modal-header">
          <button id="close_form" type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
          <h4 class="modal-title"> <?php echo $view->label ;?> </h4>
        </div>
        <div class="modal-body">
          <table>
            <tr><td><input type="hidden" name="id" id="id" value="<?php print $view->client->getChapter_ID() ?>"> <label>Name:</label>
                <span style="color:#c30;">*</span>
                <?php /*?><span class="error">* <?php echo $nameErr;?></span><?php */?>
                <span class="error"> <?php echo $nameErr;?></span> </td>
              <td><input type="text" class="form-control" name="name" id="name" value = "<?php print $view->client->getChapter_Name() ?>">
              </td>
            </tr>
            <tr>
              <td><br/>
              </td>
              <td></td>
            </tr>
            <tr>
              <td><label>Description:</label>
                <span style="color:#c30;">*</span> </td>
              <td><input type="text" class="form-control" name="description" id="description" value = "<?php print $view->client->getChapter_Description() ?>">
              </td>
            </tr>
          </table>
        </div>
      </div>
      <div class="modal-footer">
        <input id="cancel" class="btn btn-default pull-left" type="button" value ="Cancel" />
        <input id="submit" class="btn btn-primary "  type="submit" name="submit" value ="Save Changes" />
      </div>
    </div>
  </div>
  </div>
  </div>
</form>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#网络安全#的问题:求ensp的网络安全,不要步骤要完成版文件
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥20 使用Photon PUN2解决游戏得分同步的问题
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM