beytz
beytz

Reputation:

how do i invoke asp.net regExp validator from javascript?

I'm developing in asp.net 2.0. I'm using the asp:RegularExpressionValidator to check for a valid url. How do I invoke the check from a javascript function?

Upvotes: 0

Views: 304

Answers (2)

Codebrain
Codebrain

Reputation: 5613

The javascript function will fire automatically, assuming you have set the property EnableClientScript to true.

Upvotes: 0

Russ Cam
Russ Cam

Reputation: 125498

The validator will fire for the first time when you submit the form and again on any subsequent change to the textbox text.

Did you want to validate at another time? You can validate all controls in JavaScript by calling

Page_ClientValidate()

Upvotes: 2

Related Questions