How to validate the textbox
-
Hello, I am having two textboxe's i.e Credit and Debit. I want to validate the textbox so that only must be entered i.e either credit or debit. If the both the textboxe's are filled it must raise a validation that only must be filled. plz help me how to validate these textboxe's Thanks in advance :)
-
Hello, I am having two textboxe's i.e Credit and Debit. I want to validate the textbox so that only must be entered i.e either credit or debit. If the both the textboxe's are filled it must raise a validation that only must be filled. plz help me how to validate these textboxe's Thanks in advance :)
Hi, u can do from client side, function fnnotnull() { if ((document.GetelementId("<%= txtCredit.ClientID %>").value <> "") && (document.GetelementId("<%= txtdebit.ClientID %>").value <> "")) { alert("Msg here"); return false; } } u can call this in a button onclientclick event regards, kannak....
kannak
-
Hi, u can do from client side, function fnnotnull() { if ((document.GetelementId("<%= txtCredit.ClientID %>").value <> "") && (document.GetelementId("<%= txtdebit.ClientID %>").value <> "")) { alert("Msg here"); return false; } } u can call this in a button onclientclick event regards, kannak....
kannak
I guess, you directly write the code over here :) Small Correction,
sekannak wrote:
GetelementId(
getElementById :)
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net My Latest Article : IIS Remote Debugging
-
Hi, u can do from client side, function fnnotnull() { if ((document.GetelementId("<%= txtCredit.ClientID %>").value <> "") && (document.GetelementId("<%= txtdebit.ClientID %>").value <> "")) { alert("Msg here"); return false; } } u can call this in a button onclientclick event regards, kannak....
kannak
As an improvement to this, you may want to wrap this javascript into a custom validator and include server side validation also.