how to set focus to a control when a regular expression is fired

G

Guest

Hi all,

In my asp.net web form i am using regular expressions for the controls.

When the mis match occurs it should give a error message and should set the
focus to the particular controls.

How can i set focus when the regularexpression is fired.

Is it possible to call a javascript function in '<asp:Regularexpression >'..?

I am sure this scenario is common for all.

Please give me the solution to achive the task.


Thanks in advance,
Ravibabu
 
C

Curt_C [MVP]

ravi said:
Hi all,

In my asp.net web form i am using regular expressions for the controls.

When the mis match occurs it should give a error message and should set the
focus to the particular controls.

How can i set focus when the regularexpression is fired.

Is it possible to call a javascript function in '<asp:Regularexpression >'..?

I am sure this scenario is common for all.

Please give me the solution to achive the task.


Thanks in advance,
Ravibabu

The question is WHERE is the check firing? If its in the codebehind then
you will have to pass the id/name to the clientside code with the .focus
call to set it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top