简体   繁体   中英

how to Call a Javascript or jquery when asp.net validator validate?

I have an asp.net application.. i have added validation controls added in my aspx pages. i just want to Make Enable or Disable one Image based on validator's Validate event fires on Clientside..

how can i call a Javascript when Validator controls fires Validate ?

I mean is there any Clientside event like OnValidate or afterValidate of CompareFieldValidator Control ???

Thanks

You can do it in 3 ways.

1)You can use custom validator to use your java script in the validator

2)you can fire validator from java script explicitly

3)you can use both java script and Validator together.but you need to add one condition in java script to both work together. the condition is:

if (Page_ClientValidate() == true) { put your code here }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM