doupeng2253 2015-11-18 21:54
浏览 8
已采纳

简单是没有对话框[关闭]

How can use a simple dialog box when a button is clicked?

echo '<input type="submit" name="delete" value="delete">';

Should I use on click in my button?

echo '<input type="submit" name="delete" value="delete" on click="????">';

This button deletes user information, but it would be better to ask before deleting.

if user chose "بله", then perform deletion, or if user chose "خیر", then do nothing.

Thanks

  • 写回答

1条回答 默认 最新

  • dongqiang4986 2015-11-18 21:56
    关注

    This is going to require a client-side language, such as JS.

    You can look into JS alert(), or confirm() for an "Ok" and "cancel" box.

    echo '<input type="submit" name="delete" value="delete" onclick="if!(confirm(\"Really Delete?\")) return false;">';
    

    This will create a submit button that will not submit if the user clicks cancel.

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

报告相同问题?

悬赏问题

  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作