dosf40815 2009-03-08 23:50 采纳率: 100%
浏览 38
已采纳

如果它们是由PHP设置的,为什么复选框/单选按钮和选项不可重置?

Working with XHTML 1.1

I have this login page managed in php. It contains several checkboxes, radiobuttons and a dropdownlist.

There's a lot of formchecking behind it and if something doesn't check out, the page reloads and all values are filled back into their place, except for passwords.

This means the <select>, <input type="radio" and <input type="checkbox" elements that have been selected are re-selected.

Yet when I look at the source code, the checked="checked" and selected="selected" pieces are missing. But seeing as how the reloaded page has them selected, they must have been implemented.

Yet when I click my <input type="reset" button, nothing happens. The don't get de-selected.

Fun thing is, when I select some other checkboxes, radiobuttons and change the select, the reset does work, but only on the newly clicked checkboxes and radiobuttons.

Even more weird is the fact that when I click reset, the radiobuttons, checkboxes and selects don't clear themselves, they jump back to the one that was checked or selected when PHP forced the page to reload.

What's going on here?

Using firefox by the way, checking IE now.

EDIT: IE same problem.

  • 写回答

4条回答 默认 最新

  • doubeng9407 2009-03-09 00:09
    关注

    If you're using "View Source" and the script is setting aggressive no-cache headers, it's possible that you're not seeing the source code of what's being displayed. Try it in something that shows the live DOM, like Firebug or the DOM Inspector.

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

报告相同问题?

悬赏问题

  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图