Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Page_ClientValidate is undefined in formview

I have validators inside a <asp:formview>, in order to show custom validation I am using

if (!Page_ClientValidate("groupName")) {}

I am getting an error Object Expected. How can I validate client side from the form view?

I use Page_ClientValidate for <asp:listview> and there

like image 445
William Avatar asked Jan 27 '26 22:01

William


2 Answers

The Page_ClientValidate function may sometimes be undefined, e.g. if there are no validators on the page. Check if typeof Page_ClientValidate === "function" before calling it.

like image 188
alekop Avatar answered Jan 29 '26 11:01

alekop


This would also occur if all validator's EnableClientScript properties are set to false.

like image 24
John Avatar answered Jan 29 '26 10:01

John



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!