Skip to content

Instantly share code, notes, and snippets.

@PetersonDave
Created October 3, 2013 04:20
Show Gist options
  • Save PetersonDave/6804928 to your computer and use it in GitHub Desktop.
Save PetersonDave/6804928 to your computer and use it in GitHub Desktop.
Sitecore Password-Confirmation validator
using Sitecore.Form.Core.Validators;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Sitecore.Form.Core.Client.Validators
{
public class PasswordConfimationValidator : FormCustomValidator
{
protected override bool OnServerValidate(string value)
{
Control control = this.FindControl(this.classAtributes["confirmationControlId"]);
if (control != null)
return ((TextBox) control).Text == value;
else
return false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment