Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Client Side Validation in a nested user control

Reply
Thread Tools

Client Side Validation in a nested user control

 
 
kurtzilla
Guest
Posts: n/a
 
      09-22-2004
I am having a problem getting my client side validation function to
work properly.

The container page has a validation summary and several text boxes to
capture user input such as firat and last names, address, etc. It also
contains a user control which handles 4 textboxes used to capture the
phone number only (the 4th is for an extension). This user control has
a custom validator which checks for valid input.

When the phone control is the only control that will not validate - it
fills in the validation summary correctly, as well as displaying the
text value (in this case an asterik) correctly.
However, when a control on the container page is invalid and the phone
control is invalid, only the error message for the container page's
control shows up in the summary. The text value for the user control
shows up, but the error message is not displayed.

What about the nesting is keeping the summary from showing both
messages?

I realize I may have left out some pertinent details - but just hoping
someone has run into this problem before. Please feel free to ask for
whatever info may help.

Here is the client validator function:
(the getElementByLikeId function is similar to getElementById but gets
around the problem of nested control names such as
"ctl0__ctl0__TextInputControl")

function ValidatePhoneDisplayControl(source, args) {

if((args.Value.length < 4) ||
(getElementByLikeId(source.document.forms[0],
"TextPhone2").value.length < 3) ||
(getElementByLikeId(source.document.forms[0],
"TextPhone1").value.length < 3)) {

args.IsValid = false;
}

args.IsValid = true;
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute client-side code _after_ client-side validation? Bogdan ASP .Net 2 06-09-2008 01:31 PM
Client side script after client side validation with asp.net 2.0 Boss302 ASP .Net 0 11-21-2006 08:43 AM
Client-side validation on user control =?Utf-8?B?RGF2aWQgRGF2aXM=?= ASP .Net 3 05-11-2006 01:09 PM
Using both server side validation and client side validation =?Utf-8?B?dmlkeWE=?= ASP .Net 1 06-02-2005 09:45 PM
ASP.NET Web Forms Validation Controls are Server-Side or Client-Side Validation? Matt ASP .Net 14 01-30-2004 09:15 AM



Advertisments