Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a situation where I have placed required field validator controls to the server control which needs to be validated. For all these required field validators enable client script is true.

Now at the submit button I need to call a JavaScript method 'setMovieName()' also.

I experienced that if I place onClientClick="return setMovieName() JavaScript method with button, Validators are not checked.
If I remove the JavaScript method then the validators get called.

I need to have both the things done on button click. Please help.

Thanks in advance !
Regards,
Divya
Posted
Updated 9-Jun-10 20:04pm
v2

In the last of the setMovieName() function you can call

Page_ClientValidate(grop); 


Page_ClientValidate will validate the page at client side.
 
Share this answer
 
Hi Prakash,

Thanks you so much .. this made it work ..

But another issue raised , I am also using Ajax at the page which is not getting work untill I fill all the required text boxes .. it gives error messages as per the required field validators.

I need Ajax stuff to work independently from this validators .. How do i achieve this.. Any idea will be apprciated.

Thanks again !
 
Share this answer
 
Comments
PSK_ 10-Jun-10 4:39am    
Please don't post a new question as answer, instead of this you can add comment to the answer for further query.

Regarding your question. If your want the AJAX portion to work independently in that case you can use grouping of the validation control, and do validation on the groups.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900