目前我遇到了弹出消息的问题。
消息应在第一次单击“下一步”按钮时提示。
当我们转到下一页并返回上一页,并单击相同的“下一步”按钮时,不应出现弹出消息。
我该如何解决这个问题?
这是按钮代码
<asp:Button ID="Button1" runat="server" onclick="Button1_Click1" Text="Next" Width="100px" />
这是我的 clickedOnce 的 function()
<script type="text/javascript">
window.document.onload = function()
{
var clickedOnce = false;
Button1.Button1_Click1 = function ()
{
if(!confirm('Please make sure the employee particulars and reporting line details are correct before save. \nClick OK to save and continue if all details are correct.\nClick Cancel and contact HR Admin if details appear is not up to date.'))return false;
clickedOnce = true;
}
}
</script>
谢谢。非常感谢您的善意和帮助。
请您参考如下方法:
好吧,既然你只想运行一次,你能不能给用户一个 cookie,直到他们第一次点击按钮时浏览 session 结束?如果他们有 cookie,那么您可以跳过您只想运行一次的代码行。
