weixin_33725239 2009-10-14 17:21 采纳率: 0%
浏览 15

另一个表格提交问题

I have a form that onsubmit calls an ajaxFunction()... The ajaxfunction calls a php function which returns results from a mysql db...

Problem is the back button... I want users to be able to search and then search again and then use the back button to get back to the previous search, but this wont work... Remember, the form doesnt really submit, it calls an ajaxfunction...

Do I have to make the form submit in order to use the back button?

BTW I have tried submitting the form, but the page just gets refreshed and the ajaxfunction doesnt get called and that leads to no mysql results because the php file never got called!!!

Thanks for all help guys... and let me know if you need more input...

  • 写回答

2条回答 默认 最新

  • weixin_33720452 2009-10-14 17:28
    关注

    You can submit the form to a named anchor on the current page which won't cause a server request.

    Your form:

    <form action="#anchor">
    ...
    </form>

    Your form's destination (on the same page)

    <a name="anchor">...</a>

    If you do this, the back button will navigate back to your pre-form submit address in the address bar without a page reload.

    UPDATE: Try using Really Simple History :)

    评论

报告相同问题?

悬赏问题

  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题