!函数(e){如果(“定义”!epi = typeof epi&&void 0 ! = =。$domElement=i.getFormElementBlock(e.fieldName,this. workingforminfo .$workingForm),this. ondependencystatechange =t. ondependencystatechange,this. dependencystatechange),this. ondependencystatechange,this. dependencystatechange,this. dependencystatechange,this. dependencystatechanget.workingFormInfo epi.EPiServer.Forms.Dependency.Dependant (e), this._registerEventListener (this.dependency) this.isSatisfied = this.dependency.isSatisfied,“功能”= = typeofthis.onDependencyStateChanged&&this.onDependencyStateChanged(这一点。$ domElement、this.dependantInfo this.isSatisfied), this.check ()}; t.prototype = {_registerEventListener:函数(t) {varn =; e (t)。(“改变”,函数(e, t) {n.onDependencyChangeHandler.call (n, t)})}, onDependencyChangeHandler:函数(t) {this.isSatisfied ! = = t.isSatisfied&& (this.isSatisfied = t.isSatisfied this._executeAction(),“功能”= = typeofthis.onDependencyStateChanged&&this.onDependencyStateChanged(这一点。$ domElement、this.dependantInfo this.isSatisfied), e(这一点。domElement美元).trigger(“formsDependencyStateChanged”))},检查:函数(){this.dependency.runCheck ()}, _executeAction:函数(){如果(this.dependantInfo.action) {vare = epi.EPiServer.Forms.Dependency.Actions t = this.dependantInfo.action.clientsideAction; e [t] & &“功能”= =“e [t] e [t](这)}}};varn =函数(e t) {this.workingFormInfo = t, this.conditions = e.conditions this.conditionCombination = e.conditionCombination this.isSatisfied = null, this._registerEventListener ()}; n.prototype = {_registerEventListener:函数(){如果(this.conditions&& ! (this.conditions.length < = 0)) (n = [], var t = = 0; a 0 &&e.each (m,函数(e, n){“改变”! = = n ? s [n] (i.debounce(函数(e) {e.stopPropagation (), t._handleValueChange ()}, epi.EPiServer.Forms.ThrottleTimeout, t)): s [n](函数(){t._handleValueChange.apply (t)})}), e (o)内(“formsDependencyStateChanged函数(e, n) {t._handleValueChange.apply (t)}), n.push (r.fieldName)}}}, () {this._handleValueChang runCheck:函数e ()}, _handleValueChange:函数(){var t = this.isSatisfied; this.isSatisfied = this._checkSatisfaction (), this.isSatisfied ! = = t&&e(这).trigger(“改变”,{isSatisfied: this.isSatisfied})}, _checkSatisfaction:函数(){如果(! this.conditions | | this.conditions.length < = 0)返回! 0;(var e = 0; e = 0 ||((l = document.createelement(“脚本”))。类型=“text / javascript”,l.async = n ||!1,l.defer = n ||!1,l.src =s,a.appendchild(l),i.loadedscripts.push(s)); l?i._setupcallback(l,t):t()},loadexternalcsondemand:函数(e,t){for(var n =文档.getElementsByTagname(“头”)[0],a = 0,r = e.length,o = null;一个 “)的.text(T)的.html()},htmlDecodeEntities:功能(E){风险吨=使用document.createElement(” 文本域“);返回t.innerHTML = E,t.value},isMatchedReg:功能(例如,吨){尝试{变种N =新的正则表达式(t)的.exec(E);!返回空=正&& n.length> 0}赶上(E){返回console.debug(e.message),! 1}},raiseFormsEvent:函数(T,N){风险I = e.extend(0,{类型: “形式”,workingFormInfo:T},n)的;如果(T)T $ workingForm.triggerHandler(ⅰ);否则{风险α= E( 'EPiServerForms:当量(0),[数据-f型= “形式”]:第一'); &&(A = E( “正文”)(一个||则为a.length <1!)),a.triggerHandler(I)}},injectVisitorData:函数(T){风险N = E( “FormHidden [数据epiforms-visitordatasources],[数据-F-visitordatasources]”,T $ workingForm);如果(!N && 0 == n.length){风险I = NULL; n.each(函数(){如果((I = E(本))&& i.length> 0){风险吨= NULL,N = i.data( “epiforms-visitordatasources”)|| i.data( “F-visitordatasources”); E(n.split( “ ”))每个(函数(E,N){“ 功能” == typeof运算(T =。epi.EPiServer.Forms.VisitorData [N])&& T(I)})}})}},isElementType:功能(E,T){返回e.data( “F型”)=== T},getElementName:功能(E){回报e.attr( “名称”)||即数据( “epiforms元素名称”)|| e.data( “F-元素名称”)},getElementValue:函数(t)的{返回t.hasClass( “FormFileUpload”)|| i.isElementType(T,“文件上传”)i.getPreviousPostedFiles(T):?。t.hasClass( “FormChoice”)|| i.isElementType(T, “选择”)t.find(” FormChoice__Input:选中,[数据-F-DataInput中]:勾选 “)映射(函数(T,N){回报E(N).VAL()})得到():t.hasClass(” FormSelection “)|| i.isElementType(T,” 选择“)?[]的concat(t.find( “选择”)VAL()。):t.hasClass( “FormCaptcha”)|| t.hasClass( “FormTextbox”)|| t.hasClass( “FormTextbox - textarea的”)|| i.isElementType(T, “验证码”)|| i.isElementType(T, “文本框”)ΔE( “FormTextbox__Input,[数据-F-DataInput中]”,T).VAL()。修剪():。t.hasClass( “FormRange”)|| i.isElementType(T, “范围”)E( “FormRange__Input,[数据-F-DataInput中]”,T).VAL()修剪():吨.hasClass( “Form__CustomElement”)|| i.isElementType(T, “自定义”)epi.EPiServer.Forms.Extension.getCustomElementValue(T):i.getNonSpecificElementValue(T)},getFormStepBlock:功能(E,T){返回console.warn(“这是过时的。使用getFormElementBlock()代替。 “),i.getFormElementBlock(E,T)},getFormElementBlock:函数(T,N){如果(T)返回[]; VAR I = E(” Form__Element [数据epiforms-元素名称= ' “+ T +”']”,N);返回我&& 0 == i.length ||(I = E(! “[数据-F-元素名称= ' ”+ T +“']”,N)),I},getWorkingFormFromInnerElement:函数(t)的{返回E(t)的。家长( “EPiServerForms:第一,[数据-f型= '形式']:第一”)},getFormIdentifier:功能(例如){返回e.prop( “ID”)},getPreviousPostedFiles:函数(T){风险N = t.find( “FormFileUpload__Input,[数据-F-DataInput中]。”)中,a = i.getElementName(N),r=i.getWorkingFormFromInnerElement(n),o=epi.EPiServer.Forms.Utils.getFormIdentifier(r),s=epi.EPiServer.Forms.Data.loadFormDataFromStorage(o),l=n[0].files;return e.each(s,function(e,t){if(e.indexOf("__TempData")>-1&&e.replace("__TempData","")==a&&0===l.length)return l=t,!1}),l},getNonSpecificElementValue:function(t){if(!t.attr("data-f-element-name"))return t.val().trim();var n=t.find(":input");if(0===n.length)return t.val().trim();if("input"!=n[0].tagName.toLowerCase())return e(n[0]).val().trim();var i=n[0].type.toLowerCase();return"checkbox"==i||"radio"==i?n.filter(":checked").map(function(t,n){return e(n).val()}).get():e(n[0]).val().trim()},getCurrentStepIndex:function(t){var n=e("input[name=__FormCurrentStepIndex]",t.$workingForm).val();return void 0===n||""===n.trim()||isNaN(+n)||+n>t.StepsInfo.Steps.length-1?t.StepsInfo.AllStepsAreNotLinked?n=0:e.each(t.StepsInfo.Steps,function(e,i){if(i.attachedContentLink==epi.EPiServer.CurrentPageLink&&r.isStepSatisfyDependentCondition(i,t))return n=e,!1}):n=+n,n},setCurrentStepIndex:function(t,n){return e("input[name=__FormCurrentStepIndex]",t.$workingForm).val(n),n},validateRegularExpressionValidator:function(e,t,n){return n&&n.model&&n.model.jsPattern&&""!==t?i.isMatchedReg(t,n.model.jsPattern)?{isValid:!0}:{isValid:!1,message:i.stringFormat(n.model.message,[n.model.jsPattern,n.description])}:{isValid:!0}},showNextStepOnEnterKeyDown:function(t){var n=i.getWorkingFormFromInnerElement(t.target),a=t.keyCode,r=e(".Form__NavigationBar .Form__NavigationBar__Action.btnNext, [data-f-type='navigationbar'] [data-f-navigation-next]",n),o=e(".Form__Element.FormSubmitButton, [data-f-type='submitbutton']",n).parent(".FormStep, [data-f-type='step']").filter(function(t){return!e(this).hasClass("hide")});return 13!==a||0!==o.length||null==r||!r.length||(t.preventDefault(),t.stopPropagation(),r.trigger("click"),!0)},scrollToTheTopOfForm:function(t){null!=t&&"fixed"!==t.css("position").toLowerCase()&&e(document).scrollTop()>0&&window.scrollTo(0,t.offset().top)}},Extension:{getSummarizedText:function(t,n,a){var r=a?"
”:“\ n”,o = ? t.ConfirmMessage: i.htmlDecodeEntities (t.ConfirmMessage), s = t.ElementsInfo, l = [], m = [], d =[“__FormGuid”、“__FormLanguage”,“__FormCurrentStepIndex”、“__FormSubmissionId”],p = t.ConfirmMessage ? o + r + r:“”,f = null, u =零;(var c n)如果(! (l.indexOf (replace(“__TempData”、“))> 1 | | i.isInactiveField (t、c))) {varg = c.indexOf (__TempData) > 1 ? s [replace(“__TempData”、" ")]:[c]; f = g&&g.friendlyName ? g.friendlyName:“”,(null = = (u = g&&1 = = g.customBinding ? epi.EPiServer.Forms.CustomBindingElements [g.type] (g, n [c]): n [c]) | | u instanceof Array&&0 = = = u.length | | e.isEmptyObject (u) & & (u = " "), u instanceof数组? u = e.map (u,函数(e, t){返回e ?“字符串”= =“e ?艾凡:“对象”= =“e ? e.name:无效0:零})。加入(","):u instanceof FileList&&0 = = = u.length ? u = ": (u = u.toString () .substr (0, 46) .trim())。长度> = 45 & & (u +=" ..."), e(“[name = " + c +“]”,t。workingForm美元).hasClass (FormHideInSummarized) &&m.push (c),”“f = = | |零f = = | |”“u = = | |零u = = | | d.indexOf (c) > = 0 | | m.indexOf (c) > = 0 | | (l.push (c), p + = ?。stringFormat(“{0}:{1}”+ r, [i.htmlEncodeEntities (f), i.htmlEncodeEntities (u)]):我。stringFormat(“{0}:}return p},onBeforeSubmit:function(){var t=e.Deferred();return t.resolve(),t.promise()},showSummarizedText:function(t,n,i,a){var r=e.Deferred(),o=this.getSummarizedText(n,t,e =确认(o); r.resolve (e)}, 100), r.promise ()): (r.resolve (! 0), r.promise ())}, getCustomElementValue:函数(e){返回e.val () | | e.find(“[data-f-datainput]”).val ()}, bindCustomElementValue:函数(e, t) {e.find(”。Form__CustomInput [data-f-datainput]”).val (t)}, resetCustomElementValue:函数(e) {e.find(”。Form__CustomInput [data-f-datainput]”).val (" ")}, getAllDataElements:函数e (t){返回(“。Form__Element .Form__CustomElement,[data-f-type]”,t)自身之外(“.FormStep、.FormSubmitButton .Form__Element——NonData [data-f-type = '一步'],[data-f-type = '形式'],[data-f-type = ' resetbutton '], [data-f-type = ' submitbutton '], [data-f-element-nondata]”)},isStepSatisfyDependentCondition:函数(e, t){如果(e)返回! 1;varn = e.dependField, i = a.loadFormDataFromStorage (t.Id), r = epi.EPiServer.Forms.DependConditions [e.dependCondition];回报! (n&&r&&i) | | (l._isInactiveElement (n, t) ? r (null, e.dependValue): r(我[n], e.dependValue))}, getAntiForgeryToken:函数(t){返回{antiForgeryToken: e(“输入[name = " __RequestVerificationToken]”,t。workingForm美元).val ()}}, buildSubmitRequestHeader: ffunction(t){var n={},i=this.getAntiForgeryToken(t);return e.extend(n,i),n}},Data:{loadCurrentFormDataFromStorage:function(e){var t=epi.EPiServer.Forms.Utils.getFormIdentifier(e)},saveFormDataToStorage:function(e,t){var n=epi.EPiServer.Forms.Utils.getFormIdentifier(e);return this.saveFormDataToStorage(n,t)},saveFormDataToStorage:function(e,t){var n=this.getStorage();“+ e.message)}返回t}, clearFormDataInStorage:函数(e) {removeFormDataInStorage (epi.EPiServer.Forms.Utils.getFormIdentifier (e)}, removeFormDataInStorage:函数(e) {this.getStorage () .removeItem (e)}, getStorage:函数(){返回sessionStorage}},验证:{getValidatorByValidatorType:功能(e, t){如果(e instanceof Array&&0 ! = = e.length&&t) (var n=0,i=null,a=e.length;n = 0 &&e.workingforminfo.dependencyinactiveelements.splice (t, 1)}e。美元domElement.hide (this.Config.HideDuration) e.workingFormInfo.DependencyInactiveElements.push (e.dependantInfo.fieldName)},隐藏:函数(e){如果(e.isSatisfied) e。domElement.hide美元(this.Config.HideDuration), e。美元domElement.addClass(“隐藏”),e.workingFormInfo.DependencyInactiveElements.push (e.dependantInfo.fieldName);其他{e。$ domElement.show (this.Config.Show持续时间);var t = e.workingFormInfo.DependencyInactiveElements&&e.workingFormInfo.DependencyInactiveElements.indexOf (e.dependantInfo.fieldName); t > = 0 &&e.workingforminfo.dependencyinactiveelements.splice (t, 1)}}}, DependantController: t,依赖:n, _initDependencyInfos:函数(e) {vart = e.DependenciesInfo;如果(t ! (t.length < = 0)) {e.DependantControllers = []; (var n = 0; n = 0)){var r = i.getcurrentStepindex(n),o = e(n。$步骤[r]);返回e(t,o).length> 0?i.getElementValue(t):epi.episerver.forms.data.loadCurrentFormDataFromStorage(n。$工作表)[a]}},_ getTriggereventfordeDepeeElement:函数(e){return i.iselementtype(e,“textbox”)?“keyup”:“更改”},_ getTriggereventsFordEnexeElement:功能(e){return i.iselementtype(e,“textbox”)?“number”=== e.attr(“data-f-modifier”)?[“keyup”,“更改”]:[“keyup”]:[“更改”]},_ iselementofinActiveSeps:函数(t,n){var i = n.stepsinfo.steps.filter(函数(e){return!1 === e.isactive});如果(0 === i.length)返回!1; for(var a = 0; a 1)返回0}}返回! 1},_isInactiveElement:函数(e, t){返回t.DependencyInactiveElements.indexOf (e) > 1 | | this._isElementOfInactiveSteps (e, t)}},导航:{findNextStep:功能(e, t) {var n = null, i = e + 1, a = t.StepsInfo.Steps[我];如果(a) {varr = epi.EPiServer.Forms.Extension.isStepSatisfyDependentCondition (t); a.isActive = r, n = r ?答:this.findNextStep(我,t)}返回n}, findPreviousStep:函数(e, t) {var n =零,我= e 1 = t.StepsInfo.Steps[我];返回一个(n = epi.EPiServer.Forms.Extension.isStepSatisfyDependentCondition (a、t) ?答:this.findPreviousStep (i、t)), n}}}); varm = {VisitorData:{“EPiServer.Forms.Implementation.VisitorData.GeoVisitorDataSource”:函数(t) {var n = i.getWorkingFormFromInnerElement (t), a = epi.EPiServer.Forms [i.getFormIdentifier (n)] .DataSubmitController; e.get (a + / GetGeoData) .done(函数(e){如果(! t.val ()) {varn = t.data (epiforms-visitordataproperty) | | t.data(“f-visitordataproperty”);零! = e&&e [n] &&t.val (e [n])}}}}}), d ={验证器:{“EPiServer.Forms.Implementation.Validation.RequiredValidator”:函数(e、t、n){返回n (" " t = = | | t ! t.length) ? {isValid: ! 1、消息:n.model.message}: {isValid: ! 0}},“EPiServer.Forms.Implementation.Validation.RegularExpressionValidator”:i.validateRegularExpressionValidator,“EPiServer.Forms.Implementation.Validation.EmailValidator”:“EPiServer.Forms.Implementation.Validation.UrlValidator”:i.validateReg i.validateRegularExpressionValidatorularExpressionValidator”EPiServer.Forms.Implementation.Validation.DateDDMMYYYYValidator”:i.validateRegularExpressionValidator,“EPiServer.Forms.Implementation.Validation.DateMMDDYYYYValidator”:i.validateRegularExpressionValidator,“EPiServer.Forms.Implementation.Validation.DateYYYYMMDDValidator”:EPiServer.Forms i.validateRegularExpressionValidator。”Implementation.Validation.IntegerValidator”:i.validateRegularExpressionValidator,“EPiServer.Forms.Implementation.Validation.PositiveIntegerValidator”:i.validateRegularExpressionValidator,“EPiServer.Forms.Implementation.Validation.AllowedExtensionsValidator”:函数(e、t、n){如果(!var i,a,r,o,s=t,l=n.model.accept,m=epi.EPiServer.Forms.UploadExtensionBlackList.split(","),d=void 0==l||l.length<1?[]:l.split(","),p=0,f=0,u=d.length,c=s.length >> 0))}(i))。长度<1 ||(o = o.tolowercase(),a.indexof(o)> = 0 ||!(r.length <1 || r.indexof(o)> - 1)))返回{isvalid:!1,消息:epi.episerver.forms.utils.stringformat(n.model.message,[l])};返回{isvalid:!0}},“episerver。forms.implentation.validation.maxfileSizevalidator“:for(e,t,n){for(var i = t,a = 0,r = i.length,o = n.model.sizeinbytes; a o)返回{isValid: ! 1、消息:epi.EPiServer.Forms.Utils.stringFormat (n.model.message [o / 1048576])}, {isValid: ! 0}},“EPiServer.Forms.Implementation.Validation.NumericValidator”:函数(e、t、n) {var我;返回t (i = t, isNaN (parseFloat(我)| | ! isFinite(我)吗? {isValid: ! 1、消息:n.model.message}: {isValid: ! 0}},“EPiServer.Forms.Implementation.Validation.CaptchaValidator”:{初始化:功能(t) {var n =; t.parents(”。FormCaptcha, data-f-type =“验证码”(“”)。FormCaptcha__Refresh,[data-f-captcha-refresh]”)内(“点击”,函数(t) {n._refreshCaptcha (e(这),t.preventDefault()})},验证:函数(e、t、n) {var i = t.trim(),返回{isValid:零! =我”“! = =我信息:n.model.message}}, onServerValidateFailed:函数(e, t) {this._refreshCaptcha (e), e.focus ()}, _refreshCaptcha:函数(e) {vart = e.hasClass (FormCaptcha) | | i.isElementType (e,“验证码”)? e: e.parents(”。FormCaptcha [data-f-type =“验证码”]”),n = t.find(”。FormCaptcha__Image [data-f-captcha-image]”)= t.find(”。FormTextbox__Input,[data-f-datainput]”);n.attr(“src”,n.attr (" src ") +“研发= " + math . random ()), a.val (" ")}}}}, p = {DependConditions:{=:函数(e, t){返回(e = e ? epi.EPiServer.Forms.Utils.getConcatString .toUpperCase (e, ", ") ():"")===( t = t ? t.toUpperCase(): " ")},不等号:函数(e, t){返回(e = e ? epi.EPiServer.Forms.Utils.getConcatString .toUpperCase (e, ", ") ():"")!==( t = t ? t.toUpperCase(): " ")},包含:功能(e, t){返回e = e ? epi.EPiServer.Forms.Utils.getConcatString (e, ", ") .toUpperCase():“”,t = t ? t.toUpperCase():“”,e.indexOf (t) > = 0}, NotContains:函数(e, t){回报! (e = e ? epi.EPiServer.Forms.Utils.getConcatString (e ,","):"")&& t | | e ! t | | e&&t&&e.toUpperCase () .indexOf (t.toUpperCase ()) < 0}, MatchRegularExpression:函数(e, t) {var n = new正则表达式(t, igm);回报n.ignoreCase = n.global = n.multiline = 0, ! t | | t&&n.test (e)}}}; e.extend (! 0 epi.EPiServer.Forms m), e.extend (! 0 epi.EPiServer.Forms d), e.extend (epi.EPiServer.Forms ! 0, p), e.extend (! 0 epi.EPiServer.Forms {CustomBindingElements: {}}), epi.EPiServer.Forms.init = function () {epi.EPiServer.Forms.__Initialized | | (epi.EPiServer.Forms.__Initialized = ! 0 e(文档)时(f涂油(){函数t (t) {t.preventDefault (), t.stopPropagation (); var n = i.getWorkingFormFromInnerElement (t.target), s = c (n);如果(! 1 = = = s.SubmittableStatus.submittable)返回p (s, s.SubmittableStatus.message) ! 1; e.when (r.onBeforeSubmit (n)),然后(函数(){var m = y (s);如果(v (m s))返回(m), E (m), ! 1; var f =函数(t) {varn = c (t), i = g (t), r = a.loadFormDataFromStorage (n.Id);返回e.extend (r, i)} (n); e.when(函数的(t, n) {var i = e.Deferred();如果(! t.ShowSummarizedData)返回i.resolve (! 0), i.promise(),返回r.showSummarizedText (n t[“__FormGuid”、“__FormLanguage”,“__FormCurrentStepIndex”、“__FormSubmissionId”],[])}(s、f)),然后(函数(a){如果(!)的回报! 1;var r = []; (var米如果(f) ! (m.indexOf(“__TempData”)> 1 | | l._isInactiveElement (m s) | | i.getFormElementBlock (m, n) .parents(”。FormStep:first, [data-f-type='step']:first").hasClass("hide"))){var u=o.getElementValidators(s.ValidationInfo,m);r=r.concat(o.validateFormValue(m,f[m],u))}var c=e.grep(r,function(e){return 0==e.isValid});if(c.length>0){var g=e.map(c,function(e){return e.message});return p(s,g.join(" ")),!1}d(t)})})}function n(e){e.preventDefault(),e.stopPropagation();var t=i.getWorkingFormFromInnerElement(e.target),n=c(t);i.raiseFormsEvent(n,{type:"formsReset",sourceEvent:e}),m(t,n),h(n.StepsInfo.Steps[0],n)}function m(t,n){if(t.get(0).reset(),n.SubmittableStatus&&!1===n.SubmittableStatus.submittable?p(n,n.SubmittableStatus.message):p(n,""),a.removeFormDataInStorage(n.Id),e("[aria-invalid=true]",t).attr("aria-invalid","false"),r.getAllDataElements(t).each(function(t,n){var a=e(n);F(a).text(""),a.removeClass("ValidationFail ValidationSuccess"),a.hasClass("FormChoice")||i.isElementType(a,"choice")?a.find("input[type=checkbox], input[type=radio]").each(function(t,n){var i=e(n);i.prop("checked",!(!i.data("epiforms-default-value")&&!i.data("f-default-value")))}):a.hasClass("FormSelection")||i.isElementType(a,"selection")?(a.find("option[disabled]:eq(0)").prop("selected",!0),a.find("option").each(function(t,n){var i=e(n);!1===i.prop("disabled")&&i.prop("selected",!(!i.data("epiforms-default-value")&&!i.data("f-default-value")))})):a.hasClass("FormFileUpload")||i.isElementType(a,"fileupload")?(f(a).text(""),C(a.find(".FormFileUpload__Input, [data-f-datainput]"))):(a.hasClass("Form__CustomElement")||i.isElementType(a,"custom"))&&r.resetCustomElementValue(a)}),n.DependantControllers&&n.DependantControllers.length)for(var o=0;o 0零!= = x[0] & &“对象”= =“x [0] x [0] .file&&Object.getPrototypeOf (x [0] .file) = = = File.prototype) {(var, = x美元,U = " ", O = 0; O < $ . length; O + +) = $ [O] .file b.append (N +“_file_”+ O, A), U + = A.name +“|”;b.append (N, U)}其他b.append (N, x); i.raiseFormsEvent (d,{类型:“formsStartSubmitting formData: b}), g.prop(“禁用”! 0),p (d, "); varB = e.ajax ({url: d.DataSubmitController + " /提交”,标题:r.buildSubmitRequestHeader (d),数据:B,缓存:! 1,类型:n.prop(“法”),processData: ! 1, contentType: ! 1、异步:epi.EPiServer.Forms.AsyncSubmit | | n.data (epiforms-async-submit) | | n.data (f-async-submit) | | ! 1}); B.done(函数(r){如果(t.preventDefault (), e(”。Form__Element__ValidationError [data-f-validationerror]”)。text (" ") ! 0 = = = r.IsSuccess) {var s = y (d);如果(e(“。FormFileUpload .FormFileUpload__Input,[data-f-type = ' fileupload '] [data-f-datainput]”,年代),每人(函数的(t, n) {e(这).val (" "), C (e(这)}),0 = = T&&0 = = v) {i.raiseFormsEvent (d,{类型:“formsNavigationNextStep targetStep: P}); var l = a.loadFormDataFromStorage (d.Id), f = e.extend (l, {__FormSubmissionId: r.Data.SubmissionId});回报a.saveFormDataToStorage (d.Id f), i.raiseFormsEvent (d,{类型:“formsSubmitted formData: b, isFinalizedSubmission: ! 1, isSuccess: r.IsSuccess, returnedResult: r}), h (P、d) ! 1} = = T&&m (n、d), i.raiseFormsEvent (d,{类型:“formsSubmitted formData: b, isFinalizedSubmission: T, isSuccess: r.IsSuccess, returnedResult: r}); var u = d.StepsInfo.Steps.length;如果(r.RedirectUrl)返回window.location.href = r.RedirectUrl ! 1; 0 = = v !P&&V 为(0函数的(t, n) {var i = null, = 0, 0){风险F = o.validateFormValue(S,P,M),U = e.grep(F,函数(E){返回!1 === e.isValid})中,c = e.grep(N。ValidationInfo,函数(E){返回e.targetElementId ===升|| e.targetElementName ===升})[0],G = E( “#” + c.targetElementId);如果(U && u.length> 0){风险v = e.map(U,函数(E){返回e.message}); g.attr( “咏叹调-无效”, “真”),a.addClass( “ValidationFail”),r.text(v.join( “ ”))。显示(),d =!1}否则a.addClass(“ ValidationSuccess ”),g.attr(“ ARIA-无效”, “假”),d =!0}回报i.raiseFormsEvent(N,{类型: “elementValidated” isValid方法:d,的ElementName:S,elementValue:p,elementIdentifier:L,元件:T,$ messageContainer:R}),d}(R,N)&&一个}),i.raiseFormsEvent(N,{类型: “formsStepValidating”,isValid方法:一})。(! “ValidationFail”,A),N $ workingForm.toggleClass( “ValidationSuccess”,A),N $ workingForm.toggleClass,一}函数f(t){风险N = i.getElementName(T)中,a = i.stringFormat(“{0} [数据epiforms联名= '{1}'],{0} [数据epiforms- 连接的名称= '{2}'] “[”。Form__Element__ValidationError “N,t.attr( ”ID“)])中,r = i.stringFormat(”{0} [数据-F-链接名称= '{1}'],{0} [数据-F-林克d-名= '{2}']”,[ “[数据-F-validationerror]” 中,n,t.attr( “ID”)]);返回E(A)。新增(R)}函数h(T,N){如果(T)如果(i.raiseFormsEvent(N,{类型: “formsNavigateToStep”,targetStep:吨}),函数(T,N){e.each(T,函数(T,A){VAR O = -1 == t.indexOf( “__ TempData的”)t.replace( “__ TempData的”, “”)!?T,S = E('[数据epiforms-元素名称=“ '+ O +'“],[数据-F-元素名称=” '+ O + “']”中,n);如果(!== 0 && s.length s.hasClass( ”!“ && s.data(FormExcludeDataRebind)” F-excludedatarebind “)){风险升= s.find(” FormChoice__Input - 复选框,[数据-F-DataInput中]:复选框“);如果(l.length> 0)e.each(1,函数(){变种T = E(本).VAL(); E(本).attr( “选中”,a.indexOf(T)> - 1)});否则如果((1- = s.find(” FormChoice__Input--radio,[数据-F-DataInput中]:无线电“))长度> 0){风险米= Array.isArray(a)一种[0]:?一个; e.each(1,函数(){风险吨= E(本).VAL(); E(本).attr( “选中”,米== T)})}否则如果(s.hasClass( “FormSelection”)|| i.isElementType(S“,选择“))E(” 选项:启用”,S)。每个(函数(T,N){E(N).attr( “选择”,a.indexOf(E(N).VAL())> - 1)});!否则,如果(s.hasClass( “FormCaptcha”)&& i.isElementType(S,”验证码 “))如果((1- = s.find(” FormFileUpload__Input,[数据-F-DataInput中]:文件 “)。)长度> 0){风险d =”“;如果(一个阵列的instanceof &&则为a.length> 0){VAR p = a.map(功能(E){回报e.name})加入( “ ”); d = d.concat(p)}!如果(“” == d){VAR U =i.stringFormat(epi.EPiServer.Forms.Messages.fileUpload.postedFile,[d]);f(s).text(u).show()}}else s.hasClass("Form__CustomElement")||i.isElementType(s,"custom")?r.bindCustomElementValue(s,a):s.find("[data-f-datainput]:first").val(a)}})}(a.loadFormDataFromStorage(n.Id),n.$workingForm),n.StepsInfo.AllStepsAreNotLinked||t.attachedContentLink==epi.EPiServer.CurrentPageLink)n.$steps.addClass("hide"),n.$steps.each(function(a,r){if(a===t.index)return e(r).removeClass("hide"),i.setCurrentStepIndex(n,t.index),!1}),i.scrollToTheTopOfForm(n.$workingForm);else{if(t.attachedUrl&&t.attachedUrl.length)return void window.location.replace(t.attachedUrl);n.StepsInfo.AllStepsAreNotLinked||p(n,epi.EPiServer.Forms.Messages.viewMode.malformStepConfiguration)}else n.$steps.hide();_(n)}function S(t){epi.EPiServer.Forms.Validators["EPiServer.Forms.Implementation.Validation.CaptchaValidator"]._refreshCaptcha(e(".Form__Element.FormCaptcha, [data-f-type='captcha']",t))}function E(t){if(t){var n=e(".Form__Element.ValidationFail",t)[0];if(n){n.scrollIntoView();var i=e("[data-f-datainput]",n);i&&i.length>0&&i[0].focus()}}}function _(t){var n=i.getCurrentStepIndex(t),a=e(".Form__NavigationBar, [data-f-type='navigationbar']",t.$workingForm);if(n<0)a.hide();else{var r=e(".Form__NavigationBar__Action.btnPrev, [data-f-navigation-previous]",a).prop("disabled",!1),o=e(".Form__NavigationBar__Action.btnNext, [data-f-navigation-next]",a).prop("disabled",!1);0!==n&&!1!==t.SubmittableStatus.submittable||r.prop("disabled",!0),n!==t.StepsInfo.Steps.length-1&&!1!==t.SubmittableStatus.submittable||o.prop("disabled",!0);var s=n+1,l=t.StepsInfo.Steps.length;e(".Form__NavigationBar, [data-f-type='navigationbar']",t.$workingForm).toggle(t.ShowNavigationBar),e(".Form__NavigationBar__ProgressBar__CurrentStep, [data-f-navigation-currentStep]",a).text(s),e(".Form__NavigationBar__ProgressBar__StepsCount, [data-f-navigation-stepcount]",a).text(l),e(".Form__NavigationBar__ProgressBar--Progress, [data-f-navigation-progress]",a).css({width:100*s/l+"%"})}}function y(t){var n=i.getCurrentStepIndex(t);return e(t.$steps[n])}function C(e){/MSIE/.test(navigator.userAgent)&&e.replaceWith(e=e.clone(!0))}a.getStorage()?(e('.EPiServerForms, [data-f-type="form"]').each(function(o,l){var m=e(l),f=c(m);f.SubmittableStatus&&!1===f.SubmittableStatus.submittable&&p(f,f.SubmittableStatus.message),function(t){if(!t||!t.StepsInfo||!t.StepsInfo.Steps)return;if(t.$steps=e(".FormStep, [data-f-type='step']",t.$workingForm),t.StepsInfo.Steps.length<2)return;h(t.StepsInfo.Steps[i.getCurrentStepIndex(t)],t),e(".Form__NavigationBar__Action.btnNext, [data-f-navigation-next]",t.$workingForm).on("click",function(n){n.preventDefault(),e.when(r.onBeforeSubmit(t.$workingForm)).then(function(){var e=y(t);if(!v(e,t))return S(e),E(e),!1;d(n)})}),e(".Form__NavigationBar__Action.btnPrev, [data-f-navigation-previous]",t.$workingForm).on("click",function(n){n.preventDefault();var r=u(t.$workingForm,function(e){return e.hasClass("FormFileUpload")||i.isElementType(e,"fileupload")});a.saveFormDataToStorage(t.Id,r);var o=s.findPreviousStep(i.getCurrentStepIndex(t),t);h(o,t);var l=e("section[data-epiforms-stepindex="+o.index+"], section[data-f-stepindex="+o.index+"]",t.$workingForm);S(l),i.raiseFormsEvent(t,{type:"formsNavigationPrevStep",targetStep:o})})}(f);for(var g=1;g = 65 t < = 90 | | 32 = = = t)返回! 1;如果(e.shiftKey&& e.altKey&& ! e.ctrlKey&&t > = 48 t < = 57 | | t > = 96 t < = 105 | 65 | = = = e.keyCode&& ! 0 = = = e.ctrlKey | | 67 = = = t&& ! 0 = = = e.ctrlKey | | 88 = = = t&& ! 0 = = = e.ctrlKey | | t > = 35 t < = 39 | | 8 t = = = | | 9 = = = t | | 13 t = = = | | 46 = = = t | | 45 = = = t)返回! 0;varn = this.value;返回(109 = = t&&189 ! = = t | |”——“! = = n [0 ])&&(!((!( e.shiftKey | | e.altKey | | e.ctrlKey | | 190 ! = = t) | | 188 t = = = | | 110 = = = t )&&/[\.,]/. 测试(n))无效0)})。(“弹起”,函数(e) {var t = this.value; isNaN (t) t (t = (t =(“-”= = = t [0 ]?"-":"")+ t.replace (/ [^ 0 - 9 \] / g, " ")) .replace (/\.(?=(.*)\.)+/ g”、“),this.value = t)}), e(”。EPiServerForms input.FormTextbox__Input .FormChoice__Input.FormChoice__Input——复选框,.FormRange__Input .FormTextbox__Input.FormUrl__Input .FormChoice__Input.FormChoice__Input——广播、.FormTextbox__Input.FormCaptcha__Input。FormHideInSummarized [data-f-type = "形式"][data-f-datainput]:没有(textarea)”)。(“keydown函数(e){返回i.showNextStepOnEnterKeyDown (e)})): e(”。EPiServerForms .Form__Status__Message,[data-f-type =“形式”)[data-f-form-statusmessage]”)。text (epi.EPiServer.Forms.ErrorMessages.cantnotworkwithoutstorage)}))}, epi.EPiServer.Forms.ExternalScriptSources.length < = 0 &&epi.episerver.forms.externalcsssources.length < = 0 ? epi.EPiServer.Forms.init (): (i.loadExternalScriptOnDemand (epi.EPiServer.Forms.ExternalScriptSources、功能(){i.raiseFormsEvent (null,{类型:“formsLoadExternalScripts”,脚本:epi.EPiServer.Forms.ExternalScriptSources}), epi.EPiServer.Forms.init ()}), i.loadExternalCssOnDemand (epi.EPiServer.Forms.ExternalCssSources,函数(){i.raiseFormsEvent (null,{类型:“formsLoadExternalCss”、Css: epi.EPiServer.Forms.ExternalCssSources})}))}其他控制台。else console. error(" form cannot work without jQuery.");}($$epiforms||$);