TextBoxWatermarkExtender and Custom validator problem

Posted by Mac on Stack Overflow See other posts from Stack Overflow or by Mac
Published on 2010-05-20T05:56:24Z Indexed on 2010/05/20 6:00 UTC
Read the original article Hit count: 250

Filed under:
|

i have two textboxes one for phone and one for email for phone textbox i have used textbox watermark extender and a filtered textbox extender provided in ajax extension toolkit as a water mark extender text iam displaying only numbers are allowed. the problem is that on client side validation of two textboxes by custom validator iam checking

function ValidatePhoneEmail(source, args) {

var txtEmail = $('#<%= txtEmail.ClientID %>');

        var txtPhone = $('#<%= txtPhone.ClientID %>');

        if (txtEmail.focus().val().trim() != '' || txtPhone.focus().val().trim() != '')
        {
                args.isValid = true;
        }
        else
        {
                args.isValid = false;
        }            
     } 

and the problem is phone textbox is not empty as it contains text "Only Numbers" so it always return false what to do..?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about ajaxtoolkit