DROPDOWNLIST Page_ClientValidate后不回传() [英] Dropdownlist doesn't postback after Page_ClientValidate()

查看:208
本文介绍了DROPDOWNLIST Page_ClientValidate后不回传()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:

我刚刚找到了解决办法。下面的函数工作(除去其他部分):

function confirmSubmit() {
     if (Page_ClientValidate("Group1")) {
         return window.confirm("Are you sure to submit the form?");
     } 
 }

但我不知道为什么,当我加入其他部分不工作。

But I am wondering why it doesn't work when I add the else part.

问:

我希望用户在表单中的所有数据填充后有一个确认对话框。
我设置的OnClientClick =在提交按钮返回的confirmSubmit()。

I want to have a confirm dialog after user fills in all the data in the form. I set onclientclick="return confirmSubmit()" in the submit button.

 function confirmSubmit() {

     if (Page_ClientValidate("Group1")) {
         return window.confirm("Are you sure to submit the form?");
     } else {

         return false;
     }
 }

如果Page_ClientValidate(组1)返回false,将DropDownList不会导致回传后,我首先选择的项目,只有当我选择DropDownList中第二次出现回发。

If Page_ClientValidate("Group1") returns false, the dropdownlist doesn't cause postback after I first select the item, and the postback only occurs when I select the dropdownlist second time.

这是什么问题?

推荐答案

我刚刚找到了解决办法。下面的函数作品(除去其他部分):

I have just found the solution. The following function works (remove the else part):

function confirmSubmit() {
     if (Page_ClientValidate("Group1")) {
         return window.confirm("Are you sure to submit the form?");
     } 
}

这篇关于DROPDOWNLIST Page_ClientValidate后不回传()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆