Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Question on the ClientValidationFunction of CustomValidator

Posted on 2006-07-19
3
Medium Priority
?
706 Views
Last Modified: 2011-10-03
function B works as expected. However function A always invalidate the checkbox status (it always think that the checkbox is unchecked.)

Anyone may offer some ideas?

function A:
function ValidateChkLegalText(sender, args)
{    var e = document.getElementById('<% =ChkLegalTextClientID %>');
    args.IsValid = e.Checked;
}

function B:
function ValidateChkLegalText(sender, args)
{
    args.IsValid = document.getElementById('<% =ChkLegalTextClientID %>').checked;
}

                        <asp:CheckBox ID="chkLegalText" runat="server"
                            Text="Checkbox text goes here."
                            ValidationGroup="Approve"  />

            <asp:CustomValidator ID="custValidatorChkBox" runat="server" ErrorMessage="Error: Checkbox is required." ValidationGroup="Approve" ClientValidationFunction="ValidateChkLegalText" Display="None"></asp:CustomValidator><br />
0
Comment
Question by:chuang4630
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
adathelad earned 2000 total points
ID: 17138717
Hi chuang4630,

Could be that as Javascript is case sensitice you need "checked" with a lowercase c in function A, as per function B:
args.IsValid = e.checked;
0
 
LVL 1

Author Comment

by:chuang4630
ID: 17138946
Hmm, let me try
0
 
LVL 1

Author Comment

by:chuang4630
ID: 17138966
Yah, you are right.

Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question