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.

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

报告相同问题?

悬赏问题

  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配