<script type="text/javascript"> AttachXFormValueChangeEventById("fd_3b78a6e72b1206",function(){ //城市等级 var fd_3b8d8f0049d9a6 = GetXFormFieldValueById("fd_3b8d8f0049d9a6"); //Group Lunch Cost var fd_3b78a6e72b1206 = GetXFormFieldValueById("fd_3b78a6e72b1206"); if('' == fd_3b78a6e72b1206){ fd_3b78a6e72b1206 = 0; } if("Tier 1 City"==fd_3b8d8f0049d9a6){//如果是一级城市 标准是3000 if(parseInt(fd_3b78a6e72b1206)<= 3000){ $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").parent().parent().parent().css("display",'none'); $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").removeAttr("validate"); $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").next().hide(); }else{ $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").parent().parent().parent().css("display",'revert'); $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").attr("validate","required"); $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").next().show(); } }else if("Tier 2 City"==fd_3b8d8f0049d9a6){ if(parseInt(fd_3b78a6e72b1206)<= 2500){ $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").parent().parent().parent().css("display",'none'); $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").removeAttr("validate"); $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").next().hide(); }else{ $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").parent().parent().parent().css("display",'revert'); $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").attr("validate","required"); $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").next().show(); } }else{ if(parseInt(fd_3b78a6e72b1206)<= 2000){ $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").parent().parent().parent().css("display",'none'); $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").removeAttr("validate"); $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").next().hide(); }else{ $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").parent().parent().parent().css("display",'revert'); $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").attr("validate","required"); $("textarea[name='extendDataFormInfo.value(fd_3b88c87c2e9d4a)']").next().show(); } } //输入值默认选中 if( fd_3b78a6e72b1206!='' && fd_3b78a6e72b1206.length>0){ $("input[name='_extendDataFormInfo.value(fd_3b88667de645f4)']").prop("checked",true); $("input[name='extendDataFormInfo.value(fd_3b88667de645f4)']").val("Bus:"); }else{ $("input[name='_extendDataFormInfo.value(fd_3b88667de645f4)']").prop("checked",false); $("input[name='extendDataFormInfo.value(fd_3b88667de645f4)']").val(""); } __cbClick(document.getElementsByName("_extendDataFormInfo.value(fd_3b88667de645f4)")[0].name.substring(1),'null',false,__xformDispatch); }); AttachXFormValueChangeEventById("fd_3b88667de645f4", function(value,domElement){ if( value == '' || value.length<=0){ $("input[name='extendDataFormInfo.value(fd_3b78a6e72b1206)']").val(""); } }); </script> <xform:viewShow> <script> Com_AddEventListener(window,"load", function(){ var data = "${kmReviewMainForm.extendDataFormInfo.formData.fd_3b78a6e72b1206}"; if(data =="" || data.length<=0){ $("input[name='extendDataFormInfo.value(fd_3b78a6e72b1206)']").parent().parent().parent().parent().css("display","none"); } }); </script> </xform:viewShow>
标签:name,必填,3b88667de645f4,校验,value,前段,fd,extendDataFormInfo,3b78a6e72b1206 From: https://www.cnblogs.com/dzx-fiona/p/17141977.html