This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<successAction> | |
<processor type="Sitecore.Form.Core.Pipelines.SuccessRedirect, Sitecore.Forms.Core"/> | |
<processor type="Custom.Pipelines.FormatSuccessMessage, Custom"/> | |
</successAction> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RecordGoogleAnalyticsSubmitAction : ISaveAction, ISubmit | |
{ | |
public void Execute(ID formid, AdaptedResultList fields, params object[] data) | |
{ | |
return; | |
} | |
public void Submit(ID formid, AdaptedResultList fields) | |
{ | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<system.net> | |
<mailSettings> | |
<smtp deliveryMethod="SpecifiedPickupDirectory"> | |
<specifiedPickupDirectory pickupDirectoryLocation="c:\temp\maildrop\"/> | |
</smtp> | |
</mailSettings> | |
</system.net> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override bool OnServerValidate(string value) | |
{ | |
// get the form | |
var form = WebUtil.GetParent<SimpleForm>(this); | |
// find another field within our form | |
var field = (SingleLineText)WebUtil.FindFirstOrDefault(form, c => c is SingleLineText && (c as SingleLineText).Result.FieldName == "City"); | |
// compare values between this field (State) and the value of a different field (City) | |
bool isBoston = field != null && field.Result.Value.ToString() == "Boston"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static bool IsValueInFieldDatasource(IEnumerable<ControlResult> fields, string fieldName, string value) | |
{ | |
Sitecore.Diagnostics.Assert.IsNotNullOrEmpty(fieldName, "fieldName cannot be null"); | |
if (string.IsNullOrEmpty(value)) return false; | |
bool isValidSelection = false; | |
var field = fields.FirstOrDefault(x => string.Compare(x.FieldName, fieldName, StringComparison.OrdinalIgnoreCase) == 0); | |
if (field != null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Sitecore.Form.Submit | |
{ | |
public class CheckUserPassword : CheckUserAction | |
{ | |
... | |
public override void Execute(ID formid, IEnumerable<ControlResult> fields) | |
{ | |
string empty; | |
string failedMessage = base.FailedMessage; | |
string str = failedMessage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Sitecore.Form.Core.Renderings; | |
using Sitecore.Form.Web.UI.Controls; | |
namespace Custom.Form.Web.UI.Controls | |
{ | |
public class PreventDoubleClickFormRender : FormRender | |
{ | |
// disables submit button if group validator for submit is valid | |
private const string PreventDoubleSubmitJs = @"function disableSubmitButton(groupValidator, submitButton) {{ $(submitButton).disabled = Page_ClientValidate(groupValidator);}}"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// maintaining format of original source. | |
public override bool SetValidatorProperties(BaseValidator validator) | |
{ | |
base.SetValidatorProperties(validator); | |
object obj = null; | |
if (validator as ICloneable != null) | |
{ | |
obj = ((ICloneable)validator).Clone(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Move renderings example usage | |
var rendering = device.Renderings.Cast<RenderingDefinition>().SingleOrDefault(r => r.ItemID == MyRenderingId); | |
device.MoveRenderingUp(rendering); | |
item[Sitecore.FieldIDs.LayoutField] = layoutDefinition.ToXml(); | |
// DeviceDefinition Extensions | |
public static class DeviceDefinitionExtensions | |
{ | |
public static void MoveRenderingDown(this DeviceDefinition deviceDefinition, RenderingDefinition renderingDefinition) | |
{ |