doukou4066 2013-08-02 22:28
浏览 50

表单提交后更新div

my first post on Stackoverflow.

I'm building a page with bootstrap and php. I have a value load from a database in a text field in a div.

In the same page I have a button loading a modal where I have a form with the same value load in a text field.

So if the user changes the value in the form and hits update I would like the modal to close and the value update on the page.

All the modal, form, load and save database is working. The place where I'm stuck is the div refresh data part.

Any advice.

  • 写回答

3条回答 默认 最新

  • 普通网友 2013-08-02 22:32
    关注

    You can change the content of the div by using text

    $("div#some_id").text("new text")
    

    Or add HTML using html

    $("div#some_id").html("<h1>Hello</h1>")
    

    Or use a variable

    var post_name = "Update div after form submit";
    $("div#some_id").text("Thanks for adding a new post called '" + post_name + "'")
    
    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?