gpt4 book ai didi

确认按钮中的javascript函数?

转载 作者:行者123 更新时间:2023-11-30 18:44:37 25 4
gpt4 key购买 nike

如何在下面的代码中添加确认按钮? (是 - 取消)

ClientScript.RegisterStartupScript(typeof(Page), "key", "<script>alert('There is an exiting Insurance code. Are you sure do you want to Edit it?');</script>");

这个我试过了,但是没用..

 ClientScript.RegisterStartupScript(typeof(Page), "key", "if(!confirm('There is an existing insurance code . Do you want to edit?'))return false;");

谢谢!

最佳答案

使用javascript confirm对话框而不是警报。

function confirmation() {
var answer = confirm("There is an exiting Insurance code.
Are you sure do you want to Edit it?")
if (answer){
alert("You clicked OK.");
}
else{
alert("You clicked Cancel.");
}
}

关于确认按钮中的javascript函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5800028/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com