', component_bgcolor:'rgb(248, 248, 248)', component_checkBgcolor:'rgb(255, 255, 255)', component_placeHoldercolor:'rgb(153, 153, 153)', component_fcolor:'', component_formStyle:'0', component_phoenix_form_upload_limit:"Attachment can't exceed 30M", component_phoenix_from_emptyerror:"This field is required", component_phoenix_form_length_error:"The length of this field is invalid", component_phoenix_from_mailerror:"invalid email address", component_phoenix_from_phoneerror:"Please enter the correct phone number", component_phoenix_view_details:"View Details", component_phoenix_from_max_upload:"Upload up to 10 files", }; if (phoenixSite.form && phoenixSite.form !== 'undefined' && typeof phoenixSite.form.init == "function") { phoenixSite.form.init(options); } $("#component_lNpWcaqrDMzh").find("input.timePicker").each(function(){ var this_ = $(this); this_.attr("placeholder","Select time"); this_.addClass("inited"); this_.datepicker({ dateFormat: 'yyyy/mm/dd', autoClose: true }); }) $("#component_lNpWcaqrDMzh .timePickers .timePicker").on("blur",function(){ if($(this).index() == 0){ var minDate = $(this).val(); if(minDate){ $(this).parent().find(".timePicker").eq(1).datepicker({ minDate:new Date(minDate), dateFormat: 'yyyy/mm/dd', autoClose: true }); }else{ $(this).parent().find(".timePicker").eq(1).datepicker({ dateFormat: 'yyyy/mm/dd', autoClose: true }); } } if($(this).index() == 1){ var maxDate = $(this).val(); if(maxDate){ $(this).parent().find(".timePicker").eq(0).datepicker({ maxDate:new Date(maxDate), dateFormat: 'yyyy/mm/dd', autoClose: true }); }else{ $(this).parent().find(".timePicker").eq(0).datepicker({ dateFormat: 'yyyy/mm/dd', autoClose: true }); } } }) $("#component_lNpWcaqrDMzh .phoneInputprepend").each(function (indexMu,elMu) { var twoId = $(elMu).find('input:eq(1)').attr("id") var twoName = $(elMu).find('input:eq(1)').attr("name") $(elMu).find('input:eq(0)').attr("id",twoId) $(elMu).find('input:eq(0)').attr("name",twoName) }) $("#component_lNpWcaqrDMzh select[multiple]").each(function (indexMu,elMu) { var thisId = $(elMu).attr("id") var multipleHtml = '' multipleHtml += '
'+"Please select"+'
' multipleHtml += '
' $(elMu).parent().append(multipleHtml) $("#component_lNpWcaqrDMzh .multiple-select."+thisId+" ").on("click",function () { if ($("#component_lNpWcaqrDMzh .multiple-parent."+thisId+"").css("display") == "none") { $("#component_lNpWcaqrDMzh .multiple-parent."+thisId+"").css("display", "block") } else { $("#component_lNpWcaqrDMzh .multiple-parent."+thisId+"").css("display", "none") } }) $("#component_lNpWcaqrDMzh .multiple-parent."+thisId+"").on("click", "li", function (e) { e.stopPropagation() e.preventDefault() var $label = $(this).children("label") var input = this.getElementsByTagName("input")[0] if (input.checked) { input.checked = false } else { input.checked = true } //获取所有选项的值 var contents = []; $("#component_lNpWcaqrDMzh .multiple-parent."+thisId+" li").each(function (index, elem) { if (!$(elem).hasClass("group")) { var ck = $(elem).find("input")[0].checked if (ck) { var html = $(elem).children("label").html(); contents.push(html); } } }) if (contents.length > 0) { $("#component_lNpWcaqrDMzh .multiple-select."+thisId+"").empty(); for (var i = 0; i < contents.length; i++) { var span = "
"+contents[i]+"×" $("#component_lNpWcaqrDMzh .multiple-select."+thisId+"").append(span) } } else { $("#component_lNpWcaqrDMzh .multiple-select."+thisId+"").empty(); var span = "
"+"Please select"+"" $("#component_lNpWcaqrDMzh .multiple-select."+thisId+"").append(span) } $(elMu).val(contents) }); $("#component_lNpWcaqrDMzh .multiple-select."+thisId+"").on("click", ".select-delete", function (e) { e.stopPropagation() var value = $(this).parent().children(".select-value").html(); $("#component_lNpWcaqrDMzh .multiple-parent."+thisId+" ul li").each(function (index, elem) { if ($(elem).children("label").html() == value) { elem.getElementsByTagName("input")[0].checked = false; } }) $(this).parent().remove(); var len = $("#component_lNpWcaqrDMzh .multiple-select."+thisId+"").children().length; if (len == 0) { var span = "
"+"Please select"+"" $("#component_lNpWcaqrDMzh .multiple-select."+thisId+"").append(span) } var contents = []; $("#component_lNpWcaqrDMzh .multiple-parent."+thisId+" li").each(function (index, elem) { if (!$(elem).hasClass("group")) { var ck = $(elem).find("input")[0].checked if (ck) { var html = $(elem).children("label").html(); contents.push(html); } } }) $(elMu).val(contents) }) }) }catch(e){try{console && console.log && console.log(e);}catch(e){}} })(window, $);