Best Python code snippet using tox_python
formValidation.js
Source:formValidation.js
...7 if($mo('input[name=mo_customer_validation_wp_default_enable_type]').is(':checked'))8 $mo('input[name=mo_customer_validation_wp_default_enable_type]').prop("checked", false);9 }else{10 if( !$mo('input[name=mo_customer_validation_wp_default_enable_type]').is(':checked')){11 $mo('#error_message').val($mo('#error_message').val()+'WP_CHOOSE_METHOD ');12 $mo("#wp_default").prop("checked",false);13 }14 }15 //woocommerce default form16 if(!$mo("#wc_default").is(':checked')){17 if($mo('input[name=mo_customer_validation_wc_enable_type]').is(':checked'))18 $mo('input[name=mo_customer_validation_wc_enable_type]').prop("checked", false);19 }else{20 if( !$mo('input[name=mo_customer_validation_wc_enable_type]').is(':checked')){21 $mo('#error_message').val($mo('#error_message').val()+'WC_CHOOSE_METHOD ');22 $mo("#wc_default").prop("checked",false);23 }24 }25 //woocommerce checkout form26 if(!$mo("#wc_checkout").is(':checked')){27 if($mo('input[name=mo_customer_validation_wc_checkout_type]').is(':checked'))28 $mo('input[name=mo_customer_validation_wc_checkout_type]').prop("checked", false);29 }else{30 if( !$mo('input[name=mo_customer_validation_wc_checkout_type]').is(':checked')){31 $mo('#error_message').val($mo('#error_message').val()+'WC_SOCIAL_CHOOSE ');32 $mo("#wc_checkout").prop("checked",false);33 }34 }35 //buddypress form36 if(!$mo("#bbp_default").is(':checked')){37 if($mo('input[name=mo_customer_validation_bbp_enable_type]').is(':checked'))38 $mo('input[name=mo_customer_validation_bbp_enable_type]').prop("checked", false);39 }else{40 if($mo('input[name=mo_customer_validation_bbp_enable_type]').is(':checked')){41 if($mo('#bbp_phone').is(':checked')){42 if ($mo('#bbp_phone_field_key').val() === ''){43 $mo("#bbp_default").prop("checked", false);44 $mo('#bbp_phone').prop("checked", false);45 $mo('input[name=bbp_phone_field_key]').val('');46 $mo('#error_message').val($mo('#error_message').val()+'BP_PROVIDE_FIELD_KEY ');47 }else{48 $mo('input[name=bbp_phone_field_key]').val($mo('#bbp_phone_field_key').val());49 }50 }else if($mo('#bbp_both').is(':checked')){51 if ($mo('#bbp_phone_field_key1').val() === ''){52 $mo("#bbp_default").prop("checked", false);53 $mo('#bbp_both').prop("checked", false);54 $mo('input[name=bbp_phone_field_key]').val('');55 $mo('#error_message').val($mo('#error_message').val()+'BP_PROVIDE_FIELD_KEY ');56 }else{57 $mo('input[name=bbp_phone_field_key]').val($mo('#bbp_phone_field_key1').val());58 }59 }else if($mo('#bbp_rcon').is(':checked')){60 if ($mo('#bbp_rcon_server_addr').val() === '' || $mo('#bbp_rcon_server_port').val() === ''){61 $mo("#bbp_default").prop("checked", false);62 $mo('#bbp_rcon').prop("checked", false);63 $mo('input[name=bbp_rcon_server_addr]').val('');64 $mo('input[name=bbp_rcon_server_port]').val('');65 $mo('#error_message').val($mo('#error_message').val()+'GIVE_SEVER_DETAILS ');66 }67 }else{68 $mo('input[name=bbp_phone_field_key]').val('');69 }70 }else{71 $mo("#bbp_default").prop("checked", false);72 $mo('#error_message').val($mo('#error_message').val()+'BP_CHOOSE ');73 }74 }75 //simplr form76 if(!$mo("#simplr_default").is(':checked')){77 if($mo('input[name=mo_customer_validation_simplr_enable_type]').is(':checked'))78 $mo('input[name=mo_customer_validation_simplr_enable_type]').prop("checked", false);79 $mo('input[name=simplr_phone_field_key]').val('');80 }else{81 if($mo('input[name=mo_customer_validation_simplr_enable_type]').is(':checked')){82 if($mo('#simplr_phone').is(':checked')){83 if ($mo('#simplr_phone_field_key1').val() === ''){84 $mo("#simplr_default").prop("checked", false);85 $mo('#simplr_phone').prop("checked", false);86 $mo('input[name=simplr_phone_field_key]').val('');87 $mo('#error_message').val($mo('#error_message').val()+'SMPLR_PROVIDE_FIELD ');88 }else{89 $mo('input[name=simplr_phone_field_key]').val($mo('#simplr_phone_field_key1').val());90 }91 }else if($mo('#simplr_both').is(':checked')){92 if ($mo('#simplr_phone_field_key2').val() === ''){93 $mo("#simplr_default").prop("checked", false);94 $mo('#simplr_both').prop("checked", false);95 $mo('input[name=simplr_phone_field_key]').val('');96 $mo('#error_message').val($mo('#error_message').val()+'SMPLR_PROVIDE_FIELD ');97 }else{98 $mo('input[name=simplr_phone_field_key]').val($mo('#simplr_phone_field_key2').val());99 }100 }else{101 $mo('input[name=simplr_phone_field_key]').val('');102 }103 }else{104 $mo("#simplr_default").prop("checked", false);105 $mo('#error_message').val($mo('#error_message').val()+'SIMPLR_CHOOSE ');106 }107 }108 //ultimate memeber form109 if(!$mo("#um_default").is(':checked')){110 if($mo('input[name=mo_customer_validation_um_enable_type]').is(':checked'))111 $mo('input[name=mo_customer_validation_um_enable_type]').prop("checked", false);112 }else{113 if( !$mo('input[name=mo_customer_validation_um_enable_type]').is(':checked')){114 $mo('#error_message').val($mo('#error_message').val()+'UM_CHOOSE ');115 $mo("#um_default").prop("checked",false);116 }117 }118 //event registration form119 if(!$mo("#event_default").is(':checked')){120 if($mo('input[name=mo_customer_validation_event_enable_type]').is(':checked'))121 $mo('input[name=mo_customer_validation_event_enable_type]').prop("checked", false);122 }else{123 if( !$mo('input[name=mo_customer_validation_event_enable_type]').is(':checked')){124 $mo('#error_message').val($mo('#error_message').val()+'EVENT_CHOOSE ');125 $mo("#event_default").prop("checked",false);126 }127 }128 //user ultra form129 if(!$mo("#uultra_default").is(':checked')){130 if($mo('input[name=mo_customer_validation_uultra_enable_type]').is(':checked'))131 $mo('input[name=mo_customer_validation_uultra_enable_type]').prop("checked", false);132 $mo('input[name=uultra_phone_field_key]').val('');133 }else{134 if($mo('input[name=mo_customer_validation_uultra_enable_type]').is(':checked')){135 if($mo('#uultra_phone').is(':checked')){136 if ($mo('#uultra_phone_field_key').val() === ''){137 $mo("#uultra_default").prop("checked", false);138 $mo('#uultra_phone').prop("checked", false);139 $mo('input[name=uultra_phone_field_key]').val('');140 $mo('#error_message').val($mo('#error_message').val()+'UULTRA_PROVIDE_FIELD ');141 }else{142 $mo('input[name=uultra_phone_field_key]').val($mo('#uultra_phone_field_key').val());143 }144 }else if($mo('#uultra_both').is(':checked')){145 if ($mo('#uultra_phone_field_key1').val() === ''){146 $mo("#uultra_default").prop("checked", false);147 $mo('#uultra_both').prop("checked", false);148 $mo('input[name=uultra_phone_field_key]').val('');149 $mo('#error_message').val($mo('#error_message').val()+'UULTRA_PROVIDE_FIELD ');150 }else{151 $mo('input[name=uultra_phone_field_key]').val($mo('#uultra_phone_field_key1').val());152 }153 }else{154 $mo('input[name=uultra_phone_field_key]').val('');155 }156 }else{ 157 $mo("#uultra_default").prop("checked", false);158 $mo('#error_message').val($mo('#error_message').val()+'UULTRA_CHOOSE ');159 }160 }161 //crf form162 if(!$mo("#crf_default").is(':checked')){163 if($mo('input[name=mo_customer_validation_crf_enable_type]').is(':checked'))164 $mo('input[name=mo_customer_validation_crf_enable_type]').prop("checked", false);165 $mo('input[name=crf_phone_field_key]').val('');166 $mo('input[name=crf_email_field_key]').val('');167 }else{168 if($mo('input[name=mo_customer_validation_crf_enable_type]').is(':checked')){169 if($mo('#crf_phone').is(':checked')){170 if ($mo('#crf_phone_field_key').val() === ''){171 $mo("#crf_default").prop("checked", false);172 $mo('#crf_phone').prop("checked", false);173 $mo('input[name=crf_phone_field_key]').val('');174 $mo('#error_message').val($mo('#error_message').val()+'CRF_PROVIDE_PHONE_KEY ');175 }else{176 $mo('input[name=crf_phone_field_key]').val($mo('#crf_phone_field_key').val());177 }178 }else if($mo('#crf_email').is(':checked')){179 if ($mo('#crf_email_field_key').val() === ''){180 $mo("#crf_default").prop("checked", false);181 $mo('#crf_email').prop("checked", false);182 $mo('input[name=crf_email_field_key]').val('');183 $mo('#error_message').val($mo('#error_message').val()+'CRF_PROVIDE_EMAIL_KEY ');184 }else{185 $mo('input[name=crf_email_field_key]').val($mo('#crf_email_field_key').val());186 }187 }else if($mo('#crf_both').is(':checked')){188 if ($mo('#crf_phone_field_key1').val() === '' || $mo('#crf_email_field_key1').val() === ''){189 $mo("#crf_default").prop("checked", false);190 $mo('#crf_both').prop("checked", false);191 $mo('input[name=crf_phone_field_key]').val('');192 $mo('#error_message').val($mo('#error_message').val()+'CRF_PROVIDE_EMAIL_KEY CRF_PROVIDE_PHONE_KEY ');193 }else{194 $mo('input[name=crf_phone_field_key]').val($mo('#crf_phone_field_key1').val());195 $mo('input[name=crf_email_field_key]').val($mo('#crf_email_field_key1').val());196 }197 }else{198 $mo('input[name=crf_phone_field_key]').val('');199 $mo('input[name=crf_email_field_key]').val('');200 }201 }else{202 $mo("#crf_default").prop("checked", false);203 $mo('#error_message').val($mo('#error_message').val()+'CRF_CHOOSE ');204 }205 }206 //userProfile made easy207 if(!$mo("#upme_default").is(':checked')){208 if($mo('input[name=mo_customer_validation_upme_enable_type]').is(':checked'))209 $mo('input[name=mo_customer_validation_upme_enable_type]').prop("checked", false);210 $mo('input[name=upme_phone_field_key]').val('');211 }else{212 if($mo('input[name=mo_customer_validation_upme_enable_type]').is(':checked')){213 if($mo('#upme_phone').is(':checked')){214 if ($mo('#upme_phone_field_key').val() === ''){215 $mo("#upme_default").prop("checked", false);216 $mo('#upme_phone').prop("checked", false);217 $mo('input[name=upme_phone_field_key]').val('');218 $mo('#error_message').val($mo('#error_message').val()+'UPME_PROVIDE_PHONE_KEY ');219 }else{220 $mo('input[name=upme_phone_field_key]').val($mo('#upme_phone_field_key').val());221 }222 }else if($mo('#upme_both').is(':checked')){223 if ($mo('#upme_phone_field_key1').val() === ''){224 $mo("#upme_default").prop("checked", false);225 $mo('#upme_both').prop("checked", false);226 $mo('input[name=upme_phone_field_key]').val('');227 $mo('#error_message').val($mo('#error_message').val()+'UPME_PROVIDE_PHONE_KEY ');228 }else{229 $mo('input[name=upme_phone_field_key]').val($mo('#upme_phone_field_key1').val());230 }231 }else{232 $mo('input[name=upme_phone_field_key]').val('');233 }234 }else{ 235 $mo("#upme_default").prop("checked", false);236 $mo('#error_message').val($mo('#error_message').val()+'UPME_CHOOSE ');237 }238 }239 //pie registration240 if(!$mo("#pie_default").is(':checked')){241 if($mo('input[name=mo_customer_validation_pie_enable_type]').is(':checked'))242 $mo('input[name=mo_customer_validation_pie_enable_type]').prop("checked", false);243 $mo('input[name=pie_phone_field_key]').val('');244 }else{245 if($mo('input[name=mo_customer_validation_pie_enable_type]').is(':checked')){246 if($mo('#pie_phone').is(':checked')){247 if ($mo('#pie_phone_field_key').val() === ''){248 $mo("#pie_default").prop("checked", false);249 $mo('#pie_phone').prop("checked", false);250 $mo('input[name=pie_phone_field_key]').val('');251 $mo('#error_message').val($mo('#error_message').val()+'PIE_PROVIDE_PHONE_KEY ');252 }253 else{254 $mo('input[name=pie_phone_field_key]').val($mo('#pie_phone_field_key').val());255 }256 }else if($mo('#pie_both').is(':checked')){257 if ($mo('#pie_phone_field_key1').val() === ''){258 $mo("#pie_default").prop("checked", false);259 $mo('#pie_both').prop("checked", false);260 $mo('input[name=pie_phone_field_key]').val('');261 $mo('#error_message').val($mo('#error_message').val()+'PIE_PROVIDE_PHONE_KEY ');262 }263 else{264 $mo('input[name=pie_phone_field_key]').val($mo('#pie_phone_field_key1').val());265 }266 }else{267 $mo('input[name=pie_phone_field_key]').val();268 }269 }else{ 270 $mo("#pie_default").prop("checked", false);271 $mo('#error_message').val($mo('#error_message').val()+'PIE_CHOOSE ');272 }273 }274 //cf7 contact form275 if(!$mo("#cf7_contact").is(':checked')){276 if($mo('input[name=mo_customer_validation_cf7_contact_type]').is(':checked'))277 $mo('input[name=mo_customer_validation_cf7_contact_type]').prop("checked", false);278 $mo('input[name=cf7_email_field_key]').val('');279 }else{280 if($mo('input[name=mo_customer_validation_cf7_contact_type]').is(':checked')){281 if($mo('#cf7_contact_email').is(':checked')){282 if ($mo('#cf7_email_field_key').val() === ''){283 $mo("#cf7_contact").prop("checked", false);284 $mo('#cf7_contact_email').prop("checked", false);285 $mo('input[name=cf7_email_field_key]').val('');286 $mo('#error_message').val($mo('#error_message').val()+'CF7_PROVIDE_EMAIL_KEY ');287 }288 }else{289 $mo('input[name=cf7_email_field_key]').val('');290 }291 }else{ 292 $mo("#cf7_contact").prop("checked", false);293 $mo('#error_message').val($mo('#error_message').val()+'CF7_CHOOSE ');294 }295 }296 //ninja form297 if(!$mo("#ninja_form").is(':checked')){298 if($mo('input[name=mo_customer_validation_ninja_form_enable_type]').is(':checked'))299 $mo('input[name=mo_customer_validation_ninja_form_enable_type]').prop("checked", false);300 $mo('input[name^=ninja_form]').each(function() {301 $mo(this).val('');302 });303 }else{304 if(!$mo('input[name=mo_customer_validation_ninja_form_enable_type]').is(':checked')){305 $mo("#ninja_form").prop("checked", false);306 $mo('#error_message').val($mo('#error_message').val()+'NINJA_CHOOSE');307 }308 else{309 var empty = 0;310 if($mo("#ninja_form_email").is(':checked')){311 $mo("#nfe_instructions [id^=ninja_form_email_]").each(function() {312 if($mo(this).val()==''){ empty = 1; } 313 if($mo(this).prev('input[name^=ninja_form]').first().val()==''){ empty = 1; }314 });315 }316 if($mo("#ninja_form_phone").is(':checked')){317 $mo('#nfp_instructions [id^=ninja_form_phone_]').each(function() {318 if($mo(this).val()==''){ empty = 1; }319 if($mo(this).prev('input[name^=ninja_form]').first().val()==''){ empty = 1; }320 });321 }322 if($mo("#ninja_form_both").is(':checked')){323 $mo('#nfb_instructions [id^=ninja_form_both_email_]').each(function() {324 if($mo(this).val()==''){ empty = 1; }325 if($mo(this).prev('input[name^=ninja_form]').first().val()==''){ empty = 1; }326 });327 $mo('#nfb_instructions [id^=ninja_form_both_phone_]').each(function() {328 if($mo(this).val()==''){ empty = 1; }329 });330 } 331 if(empty){332 $mo("#ninja_form").prop("checked", false);333 $mo('#error_message').val($mo('#error_message').val()+'NINJA_FORM_FIELD_ERROR');334 $mo('input[name=mo_customer_validation_ninja_form_enable_type]').prop("checked", false);335 }336 }337 }338 //tml form339 if(!$mo("#tml_default").is(':checked')){340 if($mo('input[name=mo_customer_validation_tml_enable_type]').is(':checked'))341 $mo('input[name=mo_customer_validation_tml_enable_type]').prop("checked", false);342 }else{343 if( !$mo('input[name=mo_customer_validation_tml_enable_type]').is(':checked')){344 $mo('#error_message').val($mo('#error_message').val()+'TMLM_CHOOSE ');345 $mo("#tml_default").prop("checked",false);346 }347 }348 //userpro form349 if(!$mo("#userpro_registration").is(':checked')){350 if($mo('input[name=mo_customer_validation_userpro_registration_type]').is(':checked'))351 $mo('input[name=mo_customer_validation_userpro_registration_type]').prop("checked", false);352 }else{353 if( !$mo('input[name=mo_customer_validation_userpro_registration_type]').is(':checked')){354 $mo('#error_message').val($mo('#error_message').val()+'USERPRO_CHOOSE ');355 $mo("#userpro_registration").prop("checked",false);356 }357 }358 //gravity form359 if(!$mo("#gf_contact").is(':checked')){360 if($mo('input[name=mo_customer_validation_gf_contact_type]').is(':checked'))361 $mo('input[name=mo_customer_validation_gf_contact_type]').prop("checked", false);362 $mo('input[name^="gravity_form"]').each(function() {363 $mo(this).val('');364 });365 }else{366 if(!$mo('input[name=mo_customer_validation_gf_contact_type]').is(':checked')){367 $mo("#gravity_form").prop("checked", false);368 $mo('#error_message').val($mo('#error_message').val()+'GRAVITY_CHOOSE');369 }370 }371 //ultimate pro form372 if(!$mo("#wp_member_reg").is(':checked')){373 if($mo('input[name=mo_customer_validation_wp_member_reg_enable_type]').is(':checked'))374 $mo('input[name=mo_customer_validation_wp_member_reg_enable_type]').prop("checked", false);375 }else{376 if( !$mo('input[name=mo_customer_validation_wp_member_reg_enable_type]').is(':checked')){377 $mo('#error_message').val($mo('#error_message').val()+'WP_MEMBER_CHOOSE');378 $mo("#wp_member_reg").prop("checked",false);379 }380 }381 //wp member382 if(!$mo("#ultimatepro").is(':checked')){383 if($mo('input[name=mo_customer_validation_ultipro_type]').is(':checked'))384 $mo('input[name=mo_customer_validation_ultipro_type]').prop("checked", false);385 }else{386 if( !$mo('input[name=mo_customer_validation_ultipro_type]').is(':checked')){387 $mo('#error_message').val($mo('#error_message').val()+'UMPRO_CHOOSE');388 $mo("#ultimatepro").prop("checked",false);389 }390 }391 //classify theme392 if(!$mo("#classify_theme").is(':checked')){393 if($mo('input[name=mo_customer_validation_classify_type]').is(':checked'))394 $mo('input[name=mo_customer_validation_classify_type]').prop("checked", false);395 }else{396 if( !$mo('input[name=mo_customer_validation_classify_type]').is(':checked')){397 $mo('#error_message').val($mo('#error_message').val()+'CLASSIFY_THEME');398 $mo("#classify_theme").prop("checked",false);399 }400 }401 //reales theme402 if(!$mo("#reales_reg").is(':checked')){403 if($mo('input[name=mo_customer_validation_reales_enable_type]').is(':checked'))404 $mo('input[name=mo_customer_validation_reales_enable_type]').prop("checked", false);405 }else{406 if( !$mo('input[name=mo_customer_validation_reales_enable_type]').is(':checked')){407 $mo('#error_message').val($mo('#error_message').val()+'REALES_THEME');408 $mo("#reales_reg").prop("checked",false);409 }410 }411 //Default Login Form412 if(!$mo("#wp_login").is(':checked')){413 $mo('input[name=mo_customer_validation_wp_login_register_phone]').prop("checked", false);414 $mo('input[name=mo_customer_validation_wp_login_bypass_admin]').prop("checked", false);415 $mo('input[name=wp_login_phone_field_key]').val("");416 }else{417 if($mo('input[name=wp_login_phone_field_key]').val()==""){418 $mo('#error_message').val($mo('#error_message').val()+'WP_LOGIN_MISSING_KEY');419 $mo('input[name=mo_customer_validation_wp_login_register_phone]').prop("checked", false);420 $mo('input[name=mo_customer_validation_wp_login_bypass_admin]').prop("checked", false);421 $mo("#wp_login").prop("checked",false);422 }423 }424 $mo("#mo_otp_verification_settings").submit();425 });426});...
minutes_list.js
Source:minutes_list.js
1$(function() {2 setInterval(function() {3 var hours = new Date().getHours();4 var minutes = new Date().getMinutes();5 var seconds = new Date().getSeconds();6 var today = new Date().getDay();7 var weeks = new Array('æææ¥', 'ææä¸', 'ææäº', 'ææä¸', 'ææå', 'ææäº', 'ææå
');8 if (hours < 10) {9 hours = "0" + hours;10 }11 if (minutes < 10) {12 minutes = "0" + minutes;13 }14 if (seconds < 10) {15 seconds = "0" + seconds;16 }17 $("#span_time").text(hours + "æ¶" + minutes + "å" + seconds + "ç§" + " " + weeks[today]);18 });19 20 $("#textarea_content").val($("#p_notice").text());21 22 $("#input_notice_submit").click(function() {23 $.post("/notice/changeContent", {24 content: $("#textarea_content").val()25 }, function(data, status) {26 if ("success" == data) {27 alert("éç¥æåï¼")28 } else {29 alert("éç¥å¤±è´¥ï¼");30 }31 32 window.location.reload();33 });34 });35 36 $("#modal_notice").on("hidden.bs.modal", function() {37 $("#textarea_content").val($("#p_notice").text());38 });39 40 for (var counter = 0; counter < $(".a-department-name").length; counter++) {41 if ($("#input_department_name").val() == $(".a-department-name").eq(counter).text()) {42 $(".a-department-name").eq(counter).parent().addClass("active");43 break;44 }45 }46 47 $(".a-department-name").on("click", function() {48 $(".a-department-name").parent().removeClass("active");49 $(this).parent().addClass("active");50 window.location.href = "/minutes/findByDepartmentName?departmentName=" + $(this).text() + "&search=" + $("#input_search").val();51 });52 53 $("#input_search_submit").click(function() {54 window.location.href = "/minutes/findByDepartmentName?departmentName=" + $("#input_department_name").val() + "&search=" + $("#input_search").val();55 });56 57 $(".a-minutes-name").on("click", function() {58 $.post("/minutes/findById", {59 id: $(this).parent().parent().next().next().next().next().next().next().next().next().next().next().find(".minutes-id").val()60 }, function(data, status) {61 $("#input_id_information").val(data.id);62 $("#input_start_time_information").val(data.start_time);63 $("#input_place_information").val(data.place);64 $("#input_host_information").val(data.host);65 $("#input_end_time_information").val(data.end_time);66 $("#input_leaver_information").val(data.leaver);67 $("#input_minutes_name_information").val(data.minutes_name);68 $("#input_later_information").val(data.later);69 $("#input_attendees_information").val(data.attendees);70 $("#input_absenteeismer_information").val(data.absenteeismer);71 $("#textarea_minutes_content_information").val(data.content);72 });73 });74 75 $("#input_host_information").click(function() {76 $("#h_flag").text("ä¿®æ¹ä¸»æ人");77 78 for (var data in $("#input_host_information").val().split(";")) {79 $("#div_right").append("<li><span>" + $("#input_host_information").val().split(";")[data] + "</span></li>")80 }81 });82 83 $("#input_leaver_information").click(function() {84 $("#h_flag").text("ä¿®æ¹è¯·å人");85 86 for (var data in $("#input_leaver_information").val().split(";")) {87 $("#div_right").append("<li><span>" + $("#input_leaver_information").val().split(";")[data] + "</span></li>")88 }89 });90 91 $("#input_later_information").click(function() {92 $("#h_flag").text("ä¿®æ¹è¿å°äºº");93 94 for (var data in $("#input_later_information").val().split(";")) {95 $("#div_right").append("<li><span>" + $("#input_later_information").val().split(";")[data] + "</span></li>")96 }97 });98 99 $("#input_absenteeismer_information").click(function() {100 $("#h_flag").text("ä¿®æ¹æ·ä¼äºº");101 102 for (var data in $("#input_absenteeismer_information").val().split(";")) {103 $("#div_right").append("<li><span>" + $("#input_absenteeismer_information").val().split(";")[data] + "</span></li>")104 }105 });106 107 $("#input_change_submit").click(function() {108 var isSubmit = true;109 if (!$("#input_start_time_information").val()) {110 isSubmit = false;111 alert("å¼ä¼æ¶é´ä¸è½ä¸ºç©ºï¼")112 }113 114 if (!$("#input_place_information").val()) {115 isSubmit = false;116 alert("ä¼è®®å°åä¸è½ä¸ºç©ºï¼")117 }118 119 if (!$("#input_host_information").val()) {120 isSubmit = false;121 alert("主æ人ä¸è½ä¸ºç©ºï¼")122 }123 124 if (!$("#input_end_time_information").val()) {125 isSubmit = false;126 alert("éä¼æ¶é´ä¸è½ä¸ºç©ºï¼")127 }128 129 if (!$("#input_minutes_name_information").val()) {130 isSubmit = false;131 alert("ä¼è®®å称ä¸è½ä¸ºç©ºï¼")132 }133 134 if (!$("#input_attendees_information").val()) {135 isSubmit = false;136 alert("åºå¸äººä¸è½ä¸ºç©ºï¼")137 }138 139 if (!$("#textarea_minutes_content_information").val()) {140 isSubmit = false;141 alert("ä¼è®®å
容ä¸è½ä¸ºç©ºï¼")142 }143 144 if (isSubmit) {145 $.post("/minutes/changeById", {146 id: $("#input_id_information").val(),147 minutesName: $("#input_minutes_name_information").val(),148 departmentName: $("#input_department_name_information").val(),149 startTime: $("#input_start_time_information").val(),150 endTime: $("#input_end_time_information").val(),151 place: $("#input_place_information").val(),152 host: $("#input_host_information").val(),153 attendees: $("#input_attendees_information").val(),154 leaver: $("#input_leaver_information").val(),155 later: $("#input_later_information").val(),156 absenteeismer: $("#input_absenteeismer_information").val(),157 content: $("#textarea_minutes_content_information").val(),158 }, function(data, status) {159 if ("success" == data) {160 alert("ä¿åæåï¼")161 } else {162 alert("ä¿å失败ï¼");163 }164 });165 }166 });167 168 $("input[value = 'å é¤']").on("click", function() {169 var id = $(this).next().val();170 171 $("#input_remove_submit").click(function() {172 if (id > 0) {173 $.post("/minutes/removeById", {174 id: id175 }, function(data, status) {176 if ("success" == data) {177 alert("å é¤æåï¼")178 } else {179 alert("å é¤å¤±è´¥ï¼");180 }181 182 window.location.reload();183 });184 }185 });186 187 $("#modal_remove").on("hidden.bs.modal", function() {188 id = -1;189 });190 });191 192 if ($("#a_current_page").text() == 1) {193 $("#li_laquo").addClass("disabled");194 $("#li_lt").addClass("disabled");195 }196 197 if ($("#a_current_page").text() == $("#a_page_count").text().substring(2, 3)) {198 $("#li_raquo").addClass("disabled");199 $("#li_gt").addClass("disabled");200 }201 202 $("#li_laquo").click(function() {203 var isPrev = true;204 if ($("#a_current_page").text() <= 1) {205 isPrev = false;206 }207 208 if (isPrev) {209 $("#a_current_page").text("1");210 $("#li_laquo").addClass("disabled");211 $("#li_lt").addClass("disabled");212 $("#li_raquo").removeClass("disabled");213 $("#li_gt").removeClass("disabled");214 window.location.href = "/minutes/findByDepartmentName?departmentName=" + $("#input_department_name").val() + "&search=" + $("#input_search").val() + "¤tPage=" + $("#a_current_page").text();215 }216 });217 218 $("#li_lt").click(function() {219 var isPrev = true;220 221 if ($("#a_current_page").text() <= 1) {222 isPrev = false;223 }224 225 if (isPrev) {226 if ($("#a_current_page").text() == 2) {227 $("#li_laquo").addClass("disabled");228 $("#li_lt").addClass("disabled");229 $("#li_raquo").removeClass("disabled");230 $("#li_gt").removeClass("disabled");231 }232 233 $("#a_current_page").text(parseInt($("#a_current_page").text()) - 1);234 window.location.href = "/minutes/findByDepartmentName?departmentName=" + $("#input_department_name").val() + "&search=" + $("#input_search").val() + "¤tPage=" + $("#a_current_page").text();235 }236 });237 238 $("#li_gt").click(function() {239 var isNext = true;240 241 if ($("#a_current_page").text() >= $("#a_page_count").text().substring(2, $("#a_page_count").text().length - 2)) {242 isNext = false;243 }244 245 if (isNext) {246 if ($("#a_current_page").text() == parseInt($("#a_page_count").text().substring(2, $("#a_page_count").text().length - 2)) - 1) {247 $("#li_laquo").removeClass("disabled");248 $("#li_lt").removeClass("disabled");249 $("#li_raquo").addClass("disabled");250 $("#li_gt").addClass("disabled");251 }252 253 $("#a_current_page").text(parseInt($("#a_current_page").text()) + 1);254 window.location.href = "/minutes/findByDepartmentName?search=" + $("#input_search").val() + "¤tPage=" + $("#a_current_page").text();255 }256 });257 258 $("#li_raquo").click(function() {259 var isNext = true;260 261 if ($("#a_current_page").text() >= $("#a_page_count").text().substring(2, $("#a_page_count").text().length - 2)) {262 isNext = false;263 }264 265 if (isNext) {266 $("#a_current_page").text($("#a_page_count").text().substring(2, $("#a_page_count").text().length - 2));267 $("#li_laquo").removeClass("disabled");268 $("#li_lt").removeClass("disabled");269 $("#li_raquo").addClass("disabled");270 $("#li_gt").addClass("disabled");271 window.location.href = "/minutes/findByDepartmentName?search=" + $("#input_search").val() + "¤tPage=" + $("#a_current_page").text();272 }273 });274 275 $("#li_go").click(function() {276 if ($.isNumeric($("#input_go").val()) && $("#input_go").val() != "") {277 $("#a_current_page").text($("#input_go").val());278 279 if ($("#input_go").val() > $("#a_page_count").text().substring(2, $("#a_page_count").text().length - 2)) {280 $("#a_current_page").text($("#a_page_count").text().substring(2, $("#a_page_count").text().length - 2));281 }282 if ($("#input_go").val() < 1) {283 $("#a_current_page").text("1");284 }285 286 window.location.href = "/minutes/findByDepartmentName?departmentName=" + $("#input_department_name").val() + "&search=" + $("#input_search").val() + "¤tPage=" + $("#a_current_page").text();287 } else {288 alert("请è¾å
¥æ°åï¼");289 $("#input_go").val("");290 }291 });292 293 $("#input_host").click(function() {294 $("#h_flag").text("主æ人");295 });296 297 $("#input_leaver").click(function() {298 $("#h_flag").text("请å人");299 });300 301 $("#input_later").click(function() {302 $("#h_flag").text("è¿å°äºº");303 });304 305 $("#input_absenteeismer").click(function() {306 $("#h_flag").text("æ·ä¼äºº");307 });308 309 $("#modal_switch").on("shown.bs.modal", function() {310 $(".a-modal-department-name").eq(0).parent().addClass("active");311 $("#div_left").html("");312 313 $.post("/findAllByDepartmentName", {314 departmentName: $(".a-modal-department-name").eq(0).text()315 }, function(data, status) {316 for (var counter = 0; counter < data.length; counter++) {317 $("#div_left").append("<li><span>" + data[counter].username + "-" + data[counter].nickname + "</span></li>");318 }319 320 for (var rightCounter = 0; rightCounter < $("#div_right li").length; rightCounter++) {321 for (var leftCounter = 0; leftCounter < $("#div_left li").length; leftCounter++) {322 if ($("#div_right li").eq(rightCounter).text() == $("#div_left li").eq(leftCounter).text()) {323 $("#div_left li").eq(leftCounter).remove();324 break;325 }326 }327 }328 });329 });330 331 $(".a-modal-department-name").on("click", function() {332 $(".a-modal-department-name").parent().removeClass("active");333 $(this).parent().addClass("active");334 $("#div_left").html("");335 336 $.post("/findAllByDepartmentName", {337 departmentName: $(this).text()338 }, function(data, status) {339 for (var counter = 0; counter < data.length; counter++) {340 $("#div_left").append("<li><span>" + data[counter].username + "-" + data[counter].nickname + "</span></li>");341 }342 343 for (var rightCounter = 0; rightCounter < $("#div_right li").length; rightCounter++) {344 for (var leftCounter = 0; leftCounter < $("#div_left li").length; leftCounter++) {345 if ($("#div_right li").eq(rightCounter).text() == $("#div_left li").eq(leftCounter).text()) {346 $("#div_left li").eq(leftCounter).remove();347 break;348 }349 }350 }351 });352 });353 354 $("#input_switch_submit").click(function() {355 if ("主æ人" == $("#h_flag").text()) {356 $("#input_host").val("");357 358 for (var counter = 0; counter < $("#div_right li").length; counter++) {359 $("#input_host").val($("#input_host").val() + $("#div_right span").eq(counter).text() + ";");360 }361 362 $("#input_host").val($("#input_host").val().substring(0, $("#input_host").val().length - 1));363 }364 365 if ("请å人" == $("#h_flag").text()) {366 $("#input_leaver").val("");367 368 for (var counter = 0; counter < $("#div_right li").length; counter++) {369 $("#input_leaver").val($("#input_leaver").val() + $("#div_right li").eq(counter).text() + ";");370 }371 372 $("#input_leaver").val($("#input_leaver").val().substring(0, $("#input_leaver").val().length - 1));373 }374 375 if ("è¿å°äºº" == $("#h_flag").text()) {376 $("#input_later").val("");377 378 for (var counter = 0; counter < $("#div_right li").length; counter++) {379 $("#input_later").val($("#input_later").val() + $("#div_right li").eq(counter).text() + ";");380 }381 382 $("#input_later").val($("#input_later").val().substring(0, $("#input_later").val().length - 1));383 }384 385 if ("æ·ä¼äºº" == $("#h_flag").text()) {386 $("#input_absenteeismer").val("");387 388 for (var counter = 0; counter < $("#div_right li").length; counter++) {389 $("#input_absenteeismer").val($("#input_absenteeismer").val() + $("#div_right li").eq(counter).text() + ";");390 }391 392 $("#input_absenteeismer").val($("#input_absenteeismer").val().substring(0, $("#input_absenteeismer").val().length - 1));393 }394 395 if ("ä¿®æ¹ä¸»æ人" == $("#h_flag").text()) {396 $("#input_host_information").val("");397 398 for (var counter = 0; counter < $("#div_right li").length; counter++) {399 $("#input_host_information").val($("#input_host_information").val() + $("#div_right span").eq(counter).text() + ";");400 }401 402 $("#input_host_information").val($("#input_host_information").val().substring(0, $("#input_host_information").val().length - 1));403 }404 405 if ("ä¿®æ¹è¯·å人" == $("#h_flag").text()) {406 $("#input_leaver_information").val("");407 408 for (var counter = 0; counter < $("#div_right li").length; counter++) {409 $("#input_leaver_information").val($("#input_leaver_information").val() + $("#div_right li").eq(counter).text() + ";");410 }411 412 $("#input_leaver_information").val($("#input_leaver_information").val().substring(0, $("#input_leaver_information").val().length - 1));413 }414 415 if ("ä¿®æ¹è¿å°äºº" == $("#h_flag").text()) {416 $("#input_later_information").val("");417 418 for (var counter = 0; counter < $("#div_right li").length; counter++) {419 $("#input_later_information").val($("#input_later_information").val() + $("#div_right li").eq(counter).text() + ";");420 }421 422 $("#input_later_information").val($("#input_later_information").val().substring(0, $("#input_later_information").val().length - 1));423 }424 425 if ("ä¿®æ¹æ·ä¼äºº" == $("#h_flag").text()) {426 $("#input_absenteeismer_information").val("");427 428 for (var counter = 0; counter < $("#div_right li").length; counter++) {429 $("#input_absenteeismer_information").val($("#input_absenteeismer_information").val() + $("#div_right li").eq(counter).text() + ";");430 }431 432 $("#input_absenteeismer_information").val($("#input_absenteeismer_information").val().substring(0, $("#input_absenteeismer_information").val().length - 1));433 }434 435 $("#modal_switch").modal("hide");436 });437 438 $("#modal_switch").on("hidden.bs.modal", function() {439 $("#div_right").html("");440 $(".a-modal-department-name").parent().removeClass("active");441 });442 443 $("#input_create_submit").click(function() {444 var isSubmit = true;445 if (!$("#input_start_time").val()) {446 isSubmit = false;447 alert("å¼ä¼æ¶é´ä¸è½ä¸ºç©ºï¼")448 }449 450 if (!$("#input_place").val()) {451 isSubmit = false;452 alert("ä¼è®®å°åä¸è½ä¸ºç©ºï¼")453 }454 455 if (!$("#input_host").val()) {456 isSubmit = false;457 alert("主æ人ä¸è½ä¸ºç©ºï¼")458 }459 460 if (!$("#input_end_time").val()) {461 isSubmit = false;462 alert("éä¼æ¶é´ä¸è½ä¸ºç©ºï¼")463 }464 465 if (!$("#input_minutes_name").val()) {466 isSubmit = false;467 alert("ä¼è®®å称ä¸è½ä¸ºç©ºï¼")468 }469 470 if (!$("#input_attendees").val()) {471 isSubmit = false;472 alert("åºå¸äººä¸è½ä¸ºç©ºï¼")473 }474 475 if (!$("#textarea_minutes_content").val()) {476 isSubmit = false;477 alert("ä¼è®®å
容ä¸è½ä¸ºç©ºï¼")478 }479 480 if (isSubmit) {481 $.post("/minutes/create", {482 minutesName: $("#input_minutes_name").val(),483 departmentName: $("#input_department_name").val(),484 startTime: $("#input_start_time").val(),485 endTime: $("#input_end_time").val(),486 place: $("#input_place").val(),487 host: $("#input_host").val(),488 attendees: $("#input_attendees").val(),489 leaver: $("#input_leaver").val(),490 later: $("#input_later").val(),491 absenteeismer: $("#input_absenteeismer").val(),492 content: $("#textarea_minutes_content").val(),493 }, function(data, status) {494 if ("success" == data) {495 alert("æ°å¢æåï¼")496 } else {497 alert("æ°å¢å¤±è´¥ï¼");498 }499 500 window.location.reload();501 });502 }503 });504 505 $("#modal_create").on("hidden.bs.modal", function() {506 $("#input_start_time").val("");507 $("#input_place").val("");508 $("#input_host").val("");509 $("#input_end_time").val("");510 $("#input_leaver").val("");511 $("#input_minutes_name").val("");512 $("#input_later").val("");513 $("#input_attendees").val("");514 $("#input_absenteeismer").val("");515 $("#textarea_minutes_content").val("");516 });517 518 $(".box").orso({519 boxl:".box_l",// 左边大çå520 boxr:".box_r",// å³è¾¹å¤§çå521 boxlrX:"li",// 移å¨å°çå522 boxon:"on",// ç¹å»æ·»å å±æ§523 idclass:true,// æ·»å çå±æ§æ¯å¦ä¸ºclassï¼true=class; false=id;524 boxlan:"#left",// å个å左移å¨æé®525 boxran:"#right",// å个åå³ç§»å¨æé®526 boxtan:"#top",// åä¸ç§»å¨ä¸ä½æé®527 boxban:"#bottom",// åä¸ç§»å¨ä¸ä½æé®528 boxalllan:"#allleft",// å
¨é¨å左移å¨æé®529 boxallran:"#allright",// å
¨é¨åå³ç§»å¨æé®...
jsClientProfile.js
Source:jsClientProfile.js
...8 GetClientProfileData();9 $("#Msg").css('visibility', 'hidden');10 $("#ddlCountry").change(function () {11 12 var SelectedCountryId = $("#ddlCountry :selected").val();13 14 var param = JSON.stringify({ action: 'state', CountryId: SelectedCountryId });15 16 BindState(param);17 });18 19 $("#ddlState").change(function () {20 21 var SelectedCountryId = $("#ddlCountry :selected").val();22 var SelectedStateId = $("#ddlState :selected").val();23 24 if (SelectedCountryId == 0 || SelectedStateId == 0)25 return;26 var param = JSON.stringify({ action: 'state', CountryId: SelectedCountryId, StateId: SelectedStateId });27 28 BindCity(param);29 });30 31 $("#btncancel").click(function () {32 33 cancelAdd();34 });35 36 37 /* choose save or update method whecn click save */38 $("#btnUpdate").click(function () {39 40 if ($("#uid").html().trim() != "") {41 Edit();42 // cancelAdd();43 }44 else {45 }46 });47});48function getParameterByName(name) {49 name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");50 var regexS = "[\\?&]" + name + "=([^&#]*)";51 var regex = new RegExp(regexS);52 var results = regex.exec(window.location.search);53 if (results == null)54 return "";55 else56 return decodeURIComponent(results[1].replace(/\+/g, " "));57}58function GetClientProfileData() {59 var SelectedID = getParameterByName("id");60 var jsondataResource = JSON.stringify({ action: 'getsinglerecord', Id: SelectedID });61 $.ajax({62 type: "POST",63 url: '../ClientProfile/' + SelectedID,64 data: jsondataResource,65 contentType: "application/json; charset=utf-8",66 dataType: "json",67 success: function (Result, status) {68 var item = Result.Data[0];69 70 if (item.Id == SelectedID) {71 72 $("#uid").html(item.Id);73 $("#txtFirstName").val(item.FirstName);74 $("#txtLastName").val(item.LastName);75 $("#txtAddress").val(item.Address);76 $("#ddlCountry").val(item.CountryId);77 $("#ddlState").val(item.StateId);78 $("#ddlCity").val(item.CityId);79 $("#txtZipcode").val(item.ZipCode);80 $("#txtPhone").val(item.Phone);81 $("#txtMobile").val(item.Mobile);82 $("#txtInitial").val(item.Initial);83 $("#txtEmail").val(item.Email);84 $("#txtWebsite").val(item.Website);85 $("#txtJobTitle").val(item.JobTitle);86 $("#txtComLegalName").val(item.CompanyLegalName);87 $("#txtComDBA").val(item.CompanyDBA);88 $("#txtComFax").val(item.CompanyFax);89 $("#txtComPhone").val(item.CompanyPhone);90 $("#txtPassword").val(item.Password);91 if (Result.MSGDiv == "No") {92 $("#Msg").css('visibility', 'hidden');93 }94 else {95 $("#Msg").css('visibility', 'visible');96 }97 }98 else {99 }100 },101 error: function (e) {102 }103 });104}105// ddlCountry binding106function BindCountry(jsonddlResource) {107 108 $.ajax({109 110 type: "POST",111 112 contentType: "application/json; charset=utf-8",113 114 url: "../Constant/GetCountryData",115 116 data: jsonddlResource,117 118 dataType: "json",119 120 success: function (Result) {121 122 $('#ddlCountry').empty();123 $('#ddlCountry').append('<option selected="selected" value="0">---select---</option>');124 125 for (var i = 0; i < Result.length; i++) {126 127 $("#ddlCountry").append($("<option></option>").val(Result[i].Id).html(Result[i].CountryName));128 }129 },130 131 error: function (Result) {132 133 alert("Error");134 }135 });136}137// ddlState binding138function BindState(jsonddlResource) {139 $.ajax({140 141 type: "POST",142 143 contentType: "application/json; charset=utf-8",144 145 url: "../Constant/GetStateData",146 147 data: jsonddlResource,148 149 dataType: "json",150 151 success: function (Result) {152 153 $('#ddlState').empty();154 $('#ddlState').append('<option selected="selected" value="0">---select---</option>');155 for (var i = 0; i < Result.length; i++) {156 157 $("#ddlState").append($("<option></option>").val(Result[i].Id).html(Result[i].StateName));158 }159 },160 161 error: function (Result) {162 163 alert("Error");164 }165 });166}167// ddlcity binding168function BindCity(jsonddlResource) {169 $.ajax({170 171 type: "POST",172 173 contentType: "application/json; charset=utf-8",174 175 url: "../Constant/GetCityData",176 177 data: jsonddlResource,178 179 dataType: "json",180 181 success: function (Result) {182 183 $('#ddlCity').empty();184 $('#ddlCity').append('<option selected="selected" value="0">---select---</option>');185 186 for (var i = 0; i < Result.length; i++) {187 188 $("#ddlCity").append($("<option></option>").val(Result[i].Id).html(Result[i].CityName));189 }190 },191 192 error: function (Result) {193 194 alert("Error");195 }196 });197}198function validatePassword() {199 200 var newPassword = $("#txtPassword").val();201 var minNumberofChars = 10;202 var maxNumberofChars = 15;203 var regularExpression = /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{6,16}$/;204 205 if (newPassword.length < minNumberofChars || newPassword.length > maxNumberofChars) {206 alert("password should contain Minimum 10 charecter");207 return false;208 }209 if (!regularExpression.test(newPassword)) {210 alert("password should contain atleast one number and one special character");211 return false;212 }213 return true;214}215//save validation216function validate() {217 218 if ($("#txtFirstName").val() == "") {219 alert("Enter Valid First Name ");220 $("#txtFirstName").focus();221 222 return false;223 }224 225 if ($("#txtWebsite").val() != "") {226 var url = $('#txtWebsite').val();227 var re = /(http(s)?:\\)?([\w-]+\.)+[\w-]+[.com|.in|.org]+(\[\?%&=]*)?/228 if (!re.test(url)) {229 alert("Enter Valid Website url ");230 231 $("#txtWebsite").val('');232 $("#txtWebsite").focus();233 234 return false;235 }236 }237 238 if ($("#txtEmail").val() == "") {239 alert("Enter Valid Email Address");240 241 $("#txtEmail").focus();242 243 return false;244 }245 246 if (!validateEmail($("#txtEmail").val())) {247 alert("Enter Valid E-Mail Address ");248 249 $("#txtEmail").val('');250 $("#txtEmail").focus();251 252 return false;253 }254 255 256 if ($("#txtLastName").val() == "") {257 alert("Enter Valid Last Name");258 259 $("#txtLastName").focus();260 261 return false;262 }263 264 if ($("#ddlCountry").val() <= 0) {265 alert("Select Valid Country");266 267 $("#ddlCountry").focus();268 269 return false;270 }271 if ($("#ddlState").val() <= 0) {272 alert("Select Valid State");273 274 $("#ddlState").focus();275 276 return false;277 }278 279 if ($("#ddlCity").val() <= 0) {280 alert("Select Valid City");281 $("#ddlCity").focus();282 283 return false;284 }285 286 if ($("#txtMobile").val() == "") {287 288 alert("Enter Valid Mobile No ");289 290 $("#txtMobile").focus();291 292 return false;293 }294 if ($("#txtPassword").val() == "") {295 alert("Enter Valid Password");296 297 $("#txtPassword").focus();298 299 return false;300 }301 if ($("#txtPassword").val() != "") {302 303 if (!validatePassword()) {304 return false;305 }306 return true;307 }308 309 if ($("#ddlIsActive").html() == "") {310 alert("Select Valid IsActive Mode");311 312 $("#ddlIsActive").focus();313 314 return false;315 }316 317 318 319 320 321 return true;322}323/* update record by ajax post method */324function Edit() {325 326 if (validate()) {327 var xhr;328 329 330 var jsondataResource = JSON.stringify({ action: 'edit', Id: $("#uid").html().trim(), FirstName: $("#txtFirstName").val().trim(), Initial: $("#txtInitial").val().trim(), LastName: $("#txtLastName").val().trim(), Address: $("#txtAddress").val(), CountryId: $("#ddlCountry :selected").val(), StateId: $("#ddlState :selected").val(), CityId: $("#ddlCity :selected").val(), Mobile: $("#txtMobile").val(), Email: $("#txtEmail").val(), Password: $("#txtPassword").val(), Zipcode: $("#txtZipcode").val(), IsActive: $("#ddlIsActive :selected").text(), JobTitle: $("#txtJobTitle").val(), ComLegalName: $("#txtComLegalName").val(), ComDBA: $("#txtComDBA").val(), ComFax: $("#txtComFax").val(), ComPhone: $("#txtComPhone").val(), Website: $("#txtWebsite").val() });331 xhr = $.ajax({332 type: "POST",333 url: "../ClientProfile/transact",334 data: jsondataResource,335 contentType: 'application/json', // content type sent to server336 dataType: 'json', // Expected data format from server337 processdata: true, // True or False338 crossDomain: true,339 success: function (msg, textStatus, xmlHttp) {340 341 result = msg;342 343 alert("Updated successfully...")344 GetClientProfileData();345 window.location = '../Dashboard';346 },347 error: function (jqXHR, textStatus, errorThrown) {348 alert('error')349 }350 });351 352 return xhr;353 }354}355/* clear all html controls when cancel click */356function cancelAdd() {357 $("#txtFirstName").val('');358 $("#txtInitial").val('');359 $("#txtLastName").val('');360 $("#txtAddress").val('');361 $("#ddlCountry").val(0);362 $("#ddlState").val(0);363 $("#ddlCity").val(0);364 $("#txtZipcode").val('');365 $("#txtWebsite").val('');366 $("#txtMobile").val('');367 $("#txtEmail").val('');368 $("#txtJobTitle").val('');369 $("#txtComLegalName").val('');370 $("#txtComDBA").val('');371 $("#txtComFax").val('');372 $("#txtPassword").val('');373 $("#txtComPhone").val('');374 $("#uid").html('');375}376/* Clear all controls & open entry dialog when add button clicked */377function addclicked(com, grid) {378 $("#myModalLabel").html('Client Creation');379 $("#txtFirstName").val('');380 $("#txtInitial").val('');381 $("#txtLastName").val('');382 $("#txtAddress").val('');383 $("#ddlCountry").val(0);384 $("#ddlState").val(0);385 $("#ddlCity").val(0);386 $("#txtZipcode").val('');387 $("#txtWebsite").val('');388 $("#txtMobile").val('');389 $("#txtEmail").val('');390 $("#txtJobTitle").val('');391 $("#txtComLegalName").val('');392 $("#txtComDBA").val('');393 $("#txtComFax").val('');394 $("#txtComPhone").val('');395 $("#uid").html('');396 $("#txtPassword").val('');397 398 399}400function validateEmail($email) {401 var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;402 return emailReg.test($email);...
cpp11_strongly_typed_enumerations_runme.js
Source:cpp11_strongly_typed_enumerations_runme.js
1var cpp11_strongly_typed_enumerations = require("cpp11_strongly_typed_enumerations");2function enumCheck(actual, expected) {3 if (actual != expected) {4 throw new Error("Enum value mismatch. Expected: " + expected + " Actual: " + actual);5 }6 return expected + 1;7}8val = 0;9val = enumCheck(cpp11_strongly_typed_enumerations.Enum1_Val1, val);10val = enumCheck(cpp11_strongly_typed_enumerations.Enum1_Val2, val);11val = enumCheck(cpp11_strongly_typed_enumerations.Enum1_Val3, 13);12val = enumCheck(cpp11_strongly_typed_enumerations.Enum1_Val4, val);13val = enumCheck(cpp11_strongly_typed_enumerations.Enum1_Val5a, 13);14val = enumCheck(cpp11_strongly_typed_enumerations.Enum1_Val6a, val);15val = 0;16val = enumCheck(cpp11_strongly_typed_enumerations.Enum2_Val1, val);17val = enumCheck(cpp11_strongly_typed_enumerations.Enum2_Val2, val);18val = enumCheck(cpp11_strongly_typed_enumerations.Enum2_Val3, 23);19val = enumCheck(cpp11_strongly_typed_enumerations.Enum2_Val4, val);20val = enumCheck(cpp11_strongly_typed_enumerations.Enum2_Val5b, 23);21val = enumCheck(cpp11_strongly_typed_enumerations.Enum2_Val6b, val);22val = 0;23val = enumCheck(cpp11_strongly_typed_enumerations.Val1, val);24val = enumCheck(cpp11_strongly_typed_enumerations.Val2, val);25val = enumCheck(cpp11_strongly_typed_enumerations.Val3, 43);26val = enumCheck(cpp11_strongly_typed_enumerations.Val4, val);27val = 0;28val = enumCheck(cpp11_strongly_typed_enumerations.Enum5_Val1, val);29val = enumCheck(cpp11_strongly_typed_enumerations.Enum5_Val2, val);30val = enumCheck(cpp11_strongly_typed_enumerations.Enum5_Val3, 53);31val = enumCheck(cpp11_strongly_typed_enumerations.Enum5_Val4, val);32val = 0;33val = enumCheck(cpp11_strongly_typed_enumerations.Enum6_Val1, val);34val = enumCheck(cpp11_strongly_typed_enumerations.Enum6_Val2, val);35val = enumCheck(cpp11_strongly_typed_enumerations.Enum6_Val3, 63);36val = enumCheck(cpp11_strongly_typed_enumerations.Enum6_Val4, val);37val = 0;38val = enumCheck(cpp11_strongly_typed_enumerations.Enum7td_Val1, val);39val = enumCheck(cpp11_strongly_typed_enumerations.Enum7td_Val2, val);40val = enumCheck(cpp11_strongly_typed_enumerations.Enum7td_Val3, 73);41val = enumCheck(cpp11_strongly_typed_enumerations.Enum7td_Val4, val);42val = 0;43val = enumCheck(cpp11_strongly_typed_enumerations.Enum8_Val1, val);44val = enumCheck(cpp11_strongly_typed_enumerations.Enum8_Val2, val);45val = enumCheck(cpp11_strongly_typed_enumerations.Enum8_Val3, 83);46val = enumCheck(cpp11_strongly_typed_enumerations.Enum8_Val4, val);47val = 0;48val = enumCheck(cpp11_strongly_typed_enumerations.Enum10_Val1, val);49val = enumCheck(cpp11_strongly_typed_enumerations.Enum10_Val2, val);50val = enumCheck(cpp11_strongly_typed_enumerations.Enum10_Val3, 103);51val = enumCheck(cpp11_strongly_typed_enumerations.Enum10_Val4, val);52val = 0;53val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum12_Val1, 1121);54val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum12_Val2, 1122);55val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum12_Val3, val);56val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum12_Val4, val);57val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum12_Val5c, 1121);58val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum12_Val6c, val);59val = 0;60val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Val1, 1131);61val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Val2, 1132);62val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Val3, val);63val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Val4, val);64val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Val5d, 1131);65val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Val6d, val);66val = 0;67val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum14_Val1, 1141);68val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum14_Val2, 1142);69val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum14_Val3, val);70val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum14_Val4, val);71val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum14_Val5e, 1141);72val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum14_Val6e, val);73// Requires nested class support to work74//val = 0;75//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum12_Val1, 3121);76//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum12_Val2, 3122);77//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum12_Val3, val);78//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum12_Val4, val);79//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum12_Val5f, 3121);80//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum12_Val6f, val);81//82//val = 0;83//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Val1, 3131);84//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Val2, 3132);85//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Val3, val);86//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Val4, val);87//88//val = 0;89//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum14_Val1, 3141);90//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum14_Val2, 3142);91//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum14_Val3, val);92//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum14_Val4, val);93//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum14_Val5g, 3141);94//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum14_Val6g, val);95val = 0;96val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum12_Val1, 2121);97val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum12_Val2, 2122);98val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum12_Val3, val);99val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum12_Val4, val);100val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum12_Val5h, 2121);101val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum12_Val6h, val);102val = 0;103val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Val1, 2131);104val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Val2, 2132);105val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Val3, val);106val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Val4, val);107val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Val5i, 2131);108val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Val6i, val);109val = 0;110val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum14_Val1, 2141);111val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum14_Val2, 2142);112val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum14_Val3, val);113val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum14_Val4, val);114val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum14_Val5j, 2141);115val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum14_Val6j, val);116// Requires nested class support to work117//val = 0;118//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum12_Val1, 4121);119//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum12_Val2, 4122);120//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum12_Val3, val);121//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum12_Val4, val);122//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum12_Val5k, 4121);123//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum12_Val6k, val);124//125//val = 0;126//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Val1, 4131);127//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Val2, 4132);128//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Val3, val);129//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Val4, val);130//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Val5l, 4131);131//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Val6l, val);132//133//val = 0;134//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum14_Val1, 4141);135//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum14_Val2, 4142);136//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum14_Val3, val);137//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum14_Val4, val);138//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum14_Val5m, 4141);139//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum14_Val6m, val);140class1 = new cpp11_strongly_typed_enumerations.Class1();141enumCheck(class1.class1Test1(cpp11_strongly_typed_enumerations.Enum1_Val5a), 13);142enumCheck(class1.class1Test2(cpp11_strongly_typed_enumerations.Class1.Enum12_Val5c), 1121);143//enumCheck(class1.class1Test3(cpp11_strongly_typed_enumerations.Class1.Struct1_Enum12_Val5f), 3121);144enumCheck(cpp11_strongly_typed_enumerations.globalTest1(cpp11_strongly_typed_enumerations.Enum1_Val5a), 13);145enumCheck(cpp11_strongly_typed_enumerations.globalTest2(cpp11_strongly_typed_enumerations.Class1.Enum12_Val5c), 1121);...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!