dongzhenyin2001 2011-03-02 15:07
浏览 130
已采纳

php Postback&Javascript:表单提交后刷新页面

I have a webpage where a user can 'add an article'; when they click to 'add an article' it opens an iframe (a pop-up modal box).

In the Iframe there is a form with 'save' and 'cancel' buttons - what I'm trying to do is make it so when the user hits 'save', it will save the data to the database, and then refresh the page.

Currently when the user hits "Save" it saves the data, but the page remains open. The only way of knowing it saved is that the text "Add Item" changes to "Edit Item".

The component that handles this whole process is listed here

The 'form' code that is what the users see and fill out is listed here: http://code.google.com/p/joomlaworks/source/browse/trunk/K2/components/com_k2/views/item/tmpl/form.php?r=604

I know very little about javascript, and only moderate knowledge of php. When the user hit's 'save', postback is generated - I just don't know how to tell from where. I'm thinking if I could put the following code into the postback it would do what I want:

window.parent.location.reload();

If anyone can help me to figure out where the postback is being generated from, and how I put that code in there it would be greatly appreciated!

  • 写回答

1条回答 默认 最新

  • doulu1907 2011-09-13 21:17
    关注

    http://community.getk2.org/forum/topics/solved-adding-articles-on-the?xg_source=activity

    That thread has the answer to the problem. I ended up writing code myself to incorporate into the K2 component.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)