Its obvious JS is called first , because Javascipt is processed at client
side and the required field validator is a server side control.

The solution is to perform what teh required field validator does, in
javascript itself. if you want to check for any empty space in textbox , u
can use some condition like

if(document.getelementbyid["tbxUrControl"].value == "")

hope this helps.

there are many javascripts available for this validation tasks. check out in
google

regards
Vivek.

On Tue, Apr 28, 2009 at 9:20 PM, shailendra deshpande <
[email protected]> wrote:

>
> Dear all
>
> I have one query regarding validation controls and javascript used in
> asp.net c#.
> I have form on which i have one textbox, required field validator and
> one button.
> I wrote a javascript to check the textbox length and assign that
> javascript function to a button on page_load(), the button also has
> "required field validator" assigned to it.
> at first time when i press the button the required field validator
> dosent work. and javascript function which returns true because it
> cheks the length > 10.
> when i take out the assigned javascript the required field validator
> works.
>
> I want that required field validator works first then javascript
> function to check length.
>
> Please give me the solution
>
>

Reply via email to