Using Telerik rad captcha with asp.net

761 Views Asked by At

I am new to telerik controls. I have a aspx form with HTML controls on it. Data will be submitted using post method. I want to use Telerik Captcha on my page.

I have added following code on my aspx page :

<form id="frmYourDetails" runat="server" method="post" action="save.aspx">
Number: <input type="text" name="CustomerNumber" id="CustomerNumber" pattern="\d{2}-(?:\d{4}-){3}\d{1}" maxlength="19" title="xx-xxxx-xxxx-xxxx-x" required >
Name :  <input type="text" name ="CustomerName" id ="CustomerName" required >

<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<telerik:RadCaptcha ID="RadCaptcha1" Runat="server" ErrorMessage="The code you entered is not valid." Display="Dynamic"></telerik:RadCaptcha>

<button type="submit" id="btnSubmit">Save</button>
</form>

How do i validate if user has entered correct value in textbox that comes with RadCaptcha? I want this validation on client side if possible.

1

There are 1 best solutions below

0
rdmptn On BEST ANSWER

Captchas do not validate on the client, only on the sever for security reasons (if they did on the client they would be next to useless).

Call the Validate() method of the captcha or the page and check the IsValid property of the captcha.

You can see more options by using the RadCaptcha events in this demo http://demos.telerik.com/aspnet-ajax/captcha/examples/serversideevents/defaultcs.aspx