Thanks it works! 

Also is there any easy way or sample, to dynamically populate list 
boxes using client side javascript on an aspx page without posting 
back to server. (ex. I wanted to show cities in a list box, when a 
state is selected from a drop down. Both cities and states are coming 
from the database)

We did this using server side code, but want a better way to do it. 
Any thoughts?


--- In [email protected], Dean Fiala 
<[EMAIL PROTECTED]> wrote:
> One of the quirks of ASP.NET validation controls. If there is 
nothing
> entered, the validation won't fire.  You need to use two validators 
in
> this case, your custom validator and a RequiredFieldValidator.
> 
> On 7/27/05, esimplest <[EMAIL PROTECTED]> wrote:
> > Hi,
> > 
> > The below code does not validate, if you just hit submit (i.e 
leaving
> > the text box with just blank) Any idea?
> > 
> > Thanks
> > ****************************************************************
> > 
> > <SCRIPT LANGUAGE="JavaScript">
> > function validateLength(oSrc, args){
> >    args.IsValid = (args.Value.length >= 8);
> > }
> > </SCRIPT>
> > 
> > <asp:Textbox id="text1" runat="server" text="">
> > </asp:Textbox>
> > 
> > <asp:CustomValidator id="CustomValidator1" runat=server
> >       ControlToValidate = "text1"
> >       ErrorMessage = "You must enter at least 8 characters!"
> >    ClientValidationFunction="validateLength" >
> > </asp:CustomValidator>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
> -- 
> Dean Fiala
> Very Practical Software, Inc
> http://www.vpsw.com







 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to