dqroc48068 2015-06-17 11:52
浏览 56
已采纳

带按钮的PHP表单

I have some experience in JAVA GUI programming and I want to achieve the same in a PHP form.

Situation: I want to have a php form with a submit button. When the button is pressed an ActionEvent should be called to update another part of the form.

How to implement such a feature with HTML,PHP,JAVASCRIPT ?

  • 写回答

3条回答 默认 最新

  • duanou8504 2015-06-17 12:00
    关注

    Load latest version of jQuery:

    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    

    HTML code:

    <form>
     <button type="button" class="formLoader">Click button</button>
     <div id="formContentToLoad"></div>
    </form>
    

    jQuery code:

    <script type="text/javascript">
    $(function(){
      $(".formLoader").click(function(){
        $("#formContentToLoad").load("scriptToRun.php");
      });
    });
    </script>
    

    Whatever markup you need to update in the form, can be put into scriptToRun.php

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 android报错 brut.common.BrutException: could not exec (exit code = 1)
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥15 复杂网络,变滞后传递熵,FDA
  • ¥20 csv格式数据集预处理及模型选择
  • ¥15 部分网页页面无法显示!
  • ¥15 怎样解决power bi 中设置管理聚合,详细信息表和详细信息列显示灰色,而不能选择相应的内容呢?