1/// <reference path="LiveFormValidation.js" /> 2function validatenumerics(key) { 3 //getting key code of pressed key 4 var keycode = (key.which) ? key.which : key.keyCode; 5 //comparing pressed keycodes 6 7 if (keycode > 31 && (keycode < 48 || keycode > 57)) { 8 return false; 9 } 10 else return true; 11}; 12 13//$.validator.messages.wordcount = 'Please enter no more than {0} words'; 14//$.validator.messages.alphanumeric = 'This field can only contain letters and numbers'; 15$.validator.addMethod("vmaxlength", $.validator.methods.maxlength, LFValidations.vmaxlength); 16$.validator.addMethod('rbrequired', function (value, element) { 17 if ($(element).closest('.Field.Radiobutton').find("input:checked").length == 1 && $(element).closest('.Field.Radiobutton').find("input:checked").val() == "&%&" && $(element).closest('.Field.Radiobutton').find('input[type=hidden]').val() == "") { 18 return false; 19 } 20 else 21 return true; 22}, LFValidations.required); 23$.validator.addMethod('cbrequired', function (value, element) { 24 if ($(element).closest('.Field.Checkbox').find("input:checked").length == 1 && $(element).closest('.Field.Checkbox').find("input:checked").val() == "&%&" && $(element).closest('.Field.Checkbox').find('input[type=hidden]').val() == "") { 25 return false; 26 } 27 else if ($(element).closest('.Field.Checkbox').find("input:checked").length < 1) 28 return false; 29 else 30 return true; 31}, LFValidations.cbrequired); 32 33$.validator.addMethod('matrixCbrequired', function (value, element) { 34 if ($(element).closest('tr').find("input:checked").length < 1) 35 return false; 36 else 37 return true; 38}, LFValidations.required); 39 40$.validator.addMethod('matrixddlrequired', function (value, element) { 41 if ($(element).find('option:selected').index() == 0) 42 return false; 43 else 44 return true; 45}, LFValidations.required); 46 47$.validator.addMethod('checkCaptcha', function (value, element) { 48 if ($(element).closest('.Field.Checkbox').find("input:checked").length < 1) 49 return false; 50 else 51 return true; 52}, LFValidations.cbrequired); 53 54$.validator.addMethod('wordcount', function (value, element) { 55 var wordCount = $(element).attr('wordcount'); 56 if ($(element).val().split(" ").length > wordCount) 57 return false; 58 else 59 return true; 60}, LFValidations.wordcount); 61 62$.validator.addMethod('alphanumeric', function (value, element) { 63 var ele = $(element).val(); 64 if (ele != "") { 65 var re = /^[a-zA-Z0-9]+$/; 66 if (re.test(ele)) 67 return true; 68 else 69 return false; 70 } 71 else 72 return true; 73}, LFValidations.alphanumeric); 74 75$.validator.addMethod('alphabetic', function (value, element) { 76 var ele = $(element).val(); 77 if (ele != "") { 78 var re = /^[a-zA-Zs]+$/; 79 if (re.test(ele)) 80 return true; 81 else 82 return false; 83 } 84 else 85 return true; 86}, LFValidations.alphabetic); 87 88$.validator.addMethod('numeric', function (value, element) { 89 var ele = $(element).val(); 90 if (ele != "") { 91 var re = new RegExp("^[0-9]{" + ele.length + "}$"); 92 if (re.test(ele)) 93 return true; 94 else 95 return false; 96 } 97 else 98 return true; 99}, LFValidations.numeric); 100 101$.validator.addMethod('custom', function (value, element) { 102 if ($(element).parent().children('.customsetting').html() != "") { 103 var re = new RegExp($(element).parent().children('.customsetting').html()); 104 if (re.test(value)) 105 return true; 106 else 107 return false; 108 } 109 else 110 return true; 111}, LFValidations.custom); 112 113 114$.validator.addMethod('scorerequired', function (value, element) { 115 if ($(element).parent().find('div input[type=hidden]').val() == "") 116 return false; 117 else 118 return true; 119}, LFValidations.scorerequired); 120 121$.validator.addMethod('scalerequired', function (value, element) { 122 if ($(element).parent().parent().find('input[type=radio]').is(":checked") == true) 123 return true; 124 else 125 return false; 126}, LFValidations.scalerequired); 127 128$.validator.addMethod('isvaliddate', function (value, element) { 129 var month, day, year, hour, minute; 130 if ($(element).val() != "") { 131 $($(element).parent().parent().find('span.Field-SubLabel-TextBox')).each(function (index, item) { 132 if ($(item).find('input').length != 0) { 133 if ($(item).find('input').attr('class').indexOf("datepicker_month") != -1)
134 month = $(item).find('input').val(); 135 else if ($(item).find('input').attr('class').indexOf("datepicker_day") != -1) 136 day = $(item).find('input').val(); 137 else if ($(item).find('input').attr('class').indexOf("datepicker_year") != -1) 138 year = $(item).find('input').val(); 139 } 140 if ($(item).find('select').length != 0) { 141 if ($(item).find('select').attr('class').indexOf("datepicker_month") != -1) 142 month = $(item).find('select').val(); 143 if (month == "0") 144 month = ""; 145 if ($(item).find('select').attr('class').indexOf("datepicker_hour") != -1) 146 hour = $(item).find('select').val(); 147 else if ($(item).find('select').attr('class').indexOf("datepicker_minute") != -1) 148 minute = $(item).find('select').val(); 149 } 150 }); 151 if (month == undefined) 152 month = ""; 153 if (day == undefined) 154 day = ""; 155 if (year == undefined) 156 year = ""; 157 if (hour == undefined) 158 hour = ""; 159 if (minute == undefined) 160 minute = ""; 161 if (month != "" && day != "" && year != "" && hour != "" && minute != "") { 162 var dt = new Date(parseInt(year, 10), parseInt(month, 10) - 1, parseInt(day, 10), parseInt(hour, 10), parseInt(minute, 10), 00, 00); 163 if (dt.getDate() != parseInt(day, 10) || dt.getMonth() != (parseInt(month, 10) - 1) || dt.getFullYear() != parseInt(year, 10)) { 164 return false; 165 } 166 else 167 return true; 168 } 169 else if (month != "" && day != "" && year != "" && hour == "" && minute == "") { 170 var dt = new Date(parseInt(year, 10), parseInt(month, 10) - 1, parseInt(day, 10), 00, 00, 00, 00); 171 if (dt.getDate() != parseInt(day, 10) || dt.getMonth() != (parseInt(month, 10) - 1) || dt.getFullYear() != parseInt(year, 10)) { 172 return false; 173 } 174 else 175 return true; 176 } 177 else if (month == "" && (day != "" || year != "")) 178 return false; 179 else if (day == "" && (month != "" || year != "")) 180 return false; 181 else if (year == "" && (day != "" || month != "")) 182 return false; 183 else if (year == "" && day == "" && month == "" && (hour != "" || minute != "")) 184 return false; 185 else if (year != "" && day != "" && month != "" && (hour == "" || minute == "")) 186 return false; 187 else 188 return true; 189 } 190 else 191 return true; 192}, LFValidations.isvaliddate); 193 194$.validator.addMethod('furequired', function (value, element) { 195 if ($(element).parent().find('.plupload_content').length == 0) 196 return true; 197 if ($(element).parent().find('.plupload_content').attr('controlid').length > 0) { 198 var object = $(element).parent().find('.plupload_content').attr('controlid') + ".files.length==0"; 199 var resume = true; 200 if ($(element).parent().find('.fileresume').length > 0) { 201 var val = $("#" + $(element).parent().find('.fileresume').attr('id')).val(); 202 if (val !== null && val.trim() !== '') { 203 resume = false; 204 } 205 } 206 207 if (eval(object) && resume) 208 return false; 209 else 210 return true; 211 } 212 else 213 return true; 214}, LFValidations.furequired); 215 216$.validator.addMethod('fbrequired', function (value, element) { 217 var ele = $(element).val(); 218 if (ele) { 219 return true; 220 } 221 else 222 return false; 223}, LFValidations.fbrequired); 224 225$(document).ready(function () { 226 227 //$(".Field .Textarea textarea") 228 229 $(".Field.Textarea textarea").bind('input propertychange', function () { 230 231 if ($(this).attr('vmaxlength') != undefined) { 232 233 var vmaxlength = $(this).attr('vmaxlength'); 234 var remainingCount = parseInt(vmaxlength) - this.value.length; 235 if (remainingCount > -1) { 236 $(this).siblings('.spancounter').text(remainingCount).removeClass('error'); 237 } 238 else { 239 $(this).siblings('.spancounter').text(remainingCount).addClass('error'); 240 } 241 } 242 else if ($(this).attr('wordcount') != undefined) { 243 244 var wordcount = $(this).attr('wordcount'); 245 var words = $(this).val().split(' '); 246 var remainingwordCount = parseInt(wordcount) - parseInt(words.length) 247 if (remainingwordCount > -1) 248 $(this).siblings('.spancounter').text(remainingwordCount).removeClass('error'); 249 else 250 $(this).siblings('.spancounter').text(remainingwordCount).addClass('error'); 251 } 252 253 });
254 255 $(".Field.Phone input[type=text].phone").each(function (index) { 256 if (typeof $(this).attr("placeholder") != 'undefined') 257 $("#" + $(this).attr("id")).mask($(this).attr("placeholder"), { clearIfNotMatch: true }); 258 }); 259 260 $(".Field.Textbox input[type=text].mask").each(function (index) { 261 if (typeof $(this).attr("placeholder") != 'undefined') 262 $("#" + $(this).attr("id")).mask($(this).attr("placeholder"), { clearIfNotMatch: true }); 263 }); 264 265 $(".Field.Password .strength").each(function (index) { 266 var options = {}; 267 options.ui = { 268 container: "#" + $(this).attr("id"), 269 showVerdictsInsideProgressBar: true, 270 progressBarEmptyPercentage: 0, 271 progressBarMinPercentage: 25, 272 viewports: { 273 progress: "#" + $(this).attr("id") + "_viewport_progress" 274 } 275 }; 276 $("#" + $(this).attr("id") + '_Password').pwstrength(options); 277 $("#" + $(this).attr("id") + '_Password').pwstrength("addRule", "testRule" + index, function (options, word, score) { 278 return word.match(/[0-9]/) && score; 279 }, 5, true); 280 }); 281 282 $('.Field.Required.Fileupload input').attr("furequired", "furequired"); 283 $(".Field.Required.Fileupload input.fileresume").removeAttr('furequired'); 284 285 $('.Field.CkEditor.Required div.Field-Container-Wide').attr("editorrequired", "true"); 286 $('.Field.CkEditor.Required div.Field-Container').attr("editorrequired", "true"); 287 288 $(".Field.CkEditor").each(function (index) { 289 if (typeof $(this).attr("guid") != 'undefined') { 290 var GUID = $(this).attr("guid").replace(/-/g, ''); 291 $(this).addClass('ck' + GUID.toLowerCase() + 'ck'); 292 } 293 }); 294 295 //Do Not Validate Required on Hidden Fields such as Allow Other in Radiobutton/Checkboxes 296 $('.Field input[type=hidden]').addClass("nrequired"); 297 298 //Validate Required on All Inputs, Textareas & Selects Except Checkbox and those that explictly have "nrequired" class 299 $(".Field.Required:not(.Checkbox) input:not(.nrequired),.Field.Required select,.Field.Required textarea").attr("required", ""); 300 301 //Validate Required on Radiobutton other fieds validate 302 $(".Field.Required.Radiobutton input[type=radio]:not(.nrequired)").attr("rbrequired", "rbrequired"); 303 304 //Validate Required on Tag 305 $(".Field.Tag.Required input").attr("tagrequired", "tagrequired"); 306 $('.Field.Tag.Required div.Field-Container-Wide').attr("tagrequired", "true"); 307 $('.Field.Tag.Required div.Field-Container').attr("tagrequired", "true"); 308 309 $(".Field.SingleReference.Required input").attr("tagrequired", "tagrequired"); 310 $('.Field.SingleReference.Required div.Field-Container-Wide').attr("tagrequired", "true"); 311 $('.Field.SingleReference.Required div.Field-Container').attr("tagrequired", "true"); 312 313 $(".Field.MultiReference.Required input").attr("tagrequired", "tagrequired"); 314 $('.Field.MultiReference.Required div.Field-Container-Wide').attr("tagrequired", "true"); 315 $('.Field.MultiReference.Required div.Field-Container').attr("tagrequired", "true"); 316 317 //Add attribute for Captcha 318 $('.Field.Captcha .mliveformcaptcha .textarea').attr("aria-label", "No value"); 319 320 //Validate Required on Checkbox 321 $(".Field.Required.Checkbox input[type=checkbox]:not(.nrequired)").attr("cbrequired", "cbrequired"); 322 323 //Validate Required on matrix checkbox 324 $(".Field.Required.Matrix input[type=checkbox]").removeAttr('required'); 325 $(".Field.Required.Matrix input[type=checkbox]").attr("matrixCbrequired", "matrixCbrequired"); 326 327 $(".Field.Matrix input[type=checkbox]").attr("aria-label", "Close"); 328 $(".Field.Matrix input[type=radio]").attr("aria-label", "Close"); 329 330 //Validate Required on matrix dropdownlist 331 $(".Field.Required.Matrix select").removeAttr('required'); 332 $(".Field.Required.Matrix select").attr("matrixddlrequired", "matrixddlrequired"); 333 334 //Validate Email 335 $(".Field.Email input[type=text]").attr("email", "email"); 336 337 //Validate Cutom in Email field 338 $(".Field.Email.Custom input[type=text]").removeAttr('email'); 339 $(".Field.Email.Custom input[type=text]").attr("custom", "custom"); 340 341 //Validate CreditCard 342 jQuery(window).on('load', function () { 343 $(".Field.Fileupload input[type=file]").attr("aria-readonly", "true"); 344 let textarea = document.getElementById("g-recaptcha-response"); 345 if (textarea != null) { 346 textarea.setAttribute("aria-hidden", "true"); 347 textarea.setAttribute("aria-label", "do not use"); 348 textarea.setAttribute("aria-readonly", "true"); 349 } 350 });
351 352 //Validate Alphanumeric 353 $(".Field.AlphaNumeric input[type=text]").attr("alphanumeric", "alphanumeric"); 354 355 //Validate Custom 356 $(".Field.Textbox.Custom input[type=text]").attr("custom", "custom"); 357 $(".Field.Textarea.Custom textarea").attr("custom", "custom"); 358 359 //Validate Alphabetic 360 $(".Field.Alphabetic input[type=text]").attr("alphabetic", "alphabetic"); 361 362 //Validate Numeric 363 $(".Field.Numeric input[type=text]").attr("numeric", "numeric"); 364 $(".Field.CreditCard input[type=text].CVV").attr("numeric", "numeric"); 365 366 // Validate Datetime 367 $(".Field.Datetime input[type=text]").attr("isvaliddate", "isvaliddate"); 368 $(".Field.Datetime select").attr("isvaliddate", "isvaliddate"); 369 370 // Validate BirthDate 371 $(".Field.Birthdate input[type=text]").attr("isvaliddate", "isvaliddate"); 372 $(".Field.Birthdate select").attr("isvaliddate", "isvaliddate"); 373 374 //Validate StarRating 375 $(".Field.Required.StarRating input[type=hidden].starratinghidden").removeClass('nrequired').attr("scorerequired", "scorerequired"); 376 377 //Validate ScaleRating 378 $(".Field.Required.ScaleRating input[type=hidden]").attr("scalerequired", "scalerequired"); 379 $(".Field.Required.ScaleRating input[type=radio]").removeAttr('required'); 380 381 $(".Field.BrowseFile.Required input[required=required]").removeAttr('required'); 382 383 //Handle Required on Radiobutton & Checkbox Allow Other 384 //Code Commented since Valiation Plugin is unable to handle the error placement for a Textbox that's inside a label 385 //$('.Field.Radiobutton input:not([type=hidden]),.Field.Checkbox input[type=checkbox]:not([type=hidden])').change(function () { 386 // if ($(this).val() == 'Other') { 387 // $(this).closest('.Field-Container').find('input[type=text]').removeClass('nrequired').attr('required', ''); 388 // } else { 389 // $(this).closest('.Field-Container').find('input[type=text]').addClass('nrequired').removeAttr('required'); 390 // } 391 //}); 392 393 394 // Initialize validation on the entire ASP.NET form. 395 jQuery.validator.setDefaults({ 396 //debug: true, 397 onsubmit: false, 398 ignore: ".novalidate", 399 rules: { 400 success: function (error) { 401 error.remove(); 402 } 403 }, 404 errorPlacement: function (error, element) { 405 if (element.closest('.ms-form-group').hasClass("Radiobutton") || element.closest('.ms-form-group').hasClass("Checkbox")) { 406 error.appendTo(element.closest('.ms-form-group')); 407 return; 408 } 409 else if (element.closest('.Field').hasClass("Radiobutton")) { 410 error.insertAfter(element.closest('.Field').find('.Field-Container')); 411 error.insertAfter(element.closest('.Field').find('.Field-Container-Wide')); 412 return; 413 } 414 else if (element.closest('.Field').hasClass("Matrix")) { 415 if ($(element).attr('type') == 'radio' || $(element).attr('type') == 'checkbox') { 416 if ($(element).closest('tr').find('.tdBlank').find('.error').length < 1) 417 element.closest('tr').find('.tdBlank').append(error); 418 return; 419 } 420 else if ($(element).attr('type') == 'text' || $(element).attr('type') == 'number' || $(element).is('select')) { 421 $(element).closest('tbody').find('.tdBlank').find('.error').remove(); 422 $(element).closest('tbody').find('.tdBlank').first().append(error); 423 return; 424 } 425 } 426 else if (element.closest('.Field').hasClass("Phone")) { 427 if (element.hasClass('AreaCode')) 428 return; 429 } 430 else if (element.closest('.Field').hasClass("Textarea")) { 431 if (element.next('.spancounter').length) 432 error.insertAfter(element.next('.spancounter')); 433 else { 434 error.insertAfter(element.closest('.Field').find('.Field-Container')); 435 error.insertAfter(element.closest('.Field').find('.Field-Container-Wide')); 436 } 437 return; 438 } 439 else if (element.closest('.Field').hasClass("Checkbox") || element.closest('.Field').hasClass("Datetime") || element.closest('.Field').hasClass("Time") || element.closest('.Field').hasClass("Birthdate") || element.closest('.Field').hasClass("Fullname") || element.closest('.Field').hasClass("Address")) { 440 441 if (element.closest('.Field').find('label.error').length == 0 || (element.closest('.Field').find('label.error').length > 0 && element.closest('.Field').find('label.error').is(":visible") == false)) { 442 error.insertAfter(element.closest('.Field').find('.Field-Container')); 443 error.insertAfter(element.closest('.Field').find('.Field-Container-Wide')); 444 } 445 return; 446 447 } 448 449 450 451 error.insertAfter(element); 452 453 } 454 });
455 456 //$("#form1").validate({ 457 // // This prevents validation from running on every 458 // // form submission by default. 459 460 // onsubmit: false, 461 462 463 //}); 464 465 // Search for controls marked with the causesValidation flag 466 // that are contained anywhere within elements marked as 467 // validationGroups, and wire their click event up. 468 $('.validationGroup .causesValidation').click(ValidateAndSubmit); 469 $('.validationGroup .SaveAndResume').click(SaveAndResume); 470 // Select any input[type=text] elements within a validation group 471 // and attach keydown handlers to all of them. 472 $('.validationGroup :password,.validationGroup :text').keydown(function (evt) { 473 // Only execute validation if the key pressed was enter. 474 if (evt.keyCode == 13) { 475 ValidateAndSubmit(evt); 476 } 477 }); 478}); 479 480function SaveAndResume() { 481 //Finish client side operations 482 $('.Field.Currency input').each(function () { 483 $(this).select(); 484 $(this).next().val($(this).maskMoney('unmasked')[0]); 485 }); 486}; 487 488function ValidateAndSubmit(evt) { 489 490 //Show the loading icons 491 jQuery(".lfoverlay").show(); 492 jQuery(".lfmodal").show(); 493 494 //Finish client side operations 495 $('.Field.Currency input').each(function () { 496 $(this).select(); 497 $(this).next().val($(this).maskMoney('unmasked')[0]); 498 }); 499 500 501 502 $('.Field.Dropdown select').each(function () { 503 $(this).prev().val($(this).find('option:selected').text()); 504 }); 505 506 $('.Field.Radiobutton table').each(function () { 507 $(this).prev().val($(this).find('input:checked').next().text()); 508 }); 509 510 $('.Field.Checkbox table').each(function () { 511 $(this).prev().val($(this).find('input:checkbox:checked').map(function () { 512 return $(this).next().text(); 513 }).get().join(',')); 514 }); 515 516 517 518 519 // Ascend from the button that triggered this click event 520 // until we find a container element flagged with 521 // .validationGroup and store a reference to that element. 522 523 var $group = $(evt.currentTarget).parents('.validationGroup'); 524 525 var isValid = true; 526 // Descending from that .validationGroup element, find any input 527 // elements within it, iterate over them, and run validation on 528 // each of them. 529 $group.validate(); 530 var focus = new Array(); 531 $group.find(':input').each(function (i, item) { 532 if ($(item).is(':visible') && !$(item).valid()) { 533 focus.push(item); 534 isValid = false; 535 } 536 else if ($(item).attr('furequired') == "furequired" && !$(item).valid()) { 537 focus.push(item); 538 isValid = false; 539 } 540 else if ($(item).attr('fbrequired') == "fbrequired" && !$(item).valid()) { 541 focus.push(item); 542 isValid = false; 543 } 544 else if ($(item).attr('tagrequired') == "tagrequired") { 545 if ($(item).parent('div').attr('tagrequired') != undefined && $(item).parent('div').attr('tagrequired') == "true") { 546 if ($(item).parent('div').find("tag").length < 1) { 547 $("#label" + $(item).attr('tag') + "").remove(); 548 $("<label id=label" + $(item).attr('tag') + " class=\"error\">" + LFValidations.required + "</label>").insertAfter($(item)); 549 isValid = false; 550 } 551 else { 552 $("#label" + $(item).attr('tag') + "").remove(); 553 } 554 } 555 } 556 else if ($(item).attr('ckeditor') == "required") { 557 if ($(item).parent('div').attr('editorrequired') != undefined && $(item).parent('div').attr('editorrequired') == "true") { 558 $.each(CKEDITOR.instances, function (key, editor) { 559 if ($(editor.element.$).parent('div').parent('li') != undefined && $(editor.element.$).parent('div').parent('li').is(':visible') == true) { 560 if ($(item).attr('ckeditor') == $(editor.element.$).attr('ckeditor')) { 561 if (editor.getData() == "") { 562 $("#label" + $(item).attr('ckeditor') + "").remove(); 563 $("<label id=label" + $(item).attr('ckeditor') + " class=\"error\">" + LFValidations.required + "</label>").insertAfter($(item).parent('div').children('div')); 564 isValid = false; 565 } 566 else { 567 $("#label" + $(item).attr('ckeditor') + "").remove(); 568 } 569 } 570 } 571 }) 572 } 573 } 574 var pagesection_Visible = true; 575 var pagesection = $(item).closest('ul.page-break-section'); // in case of multiple captcha in a form with page breck 576 if (pagesection && !$(pagesection).is(':visible')) 577 pagesection_Visible = false; 578 if (pagesection_Visible && $(item).hasClass('g-recaptcha-response') && !$(item).hasClass('novalidate')) { 579 var captchadiv = $(item).closest('div[googlerecaptchaid]'); 580 var captcharesponse = grecaptcha.getResponse($(captchadiv).attr('googlerecaptchaid')); 581 $("#" + $(captchadiv).attr("id") + " .error").remove(); 582 if (captcharesponse.length == 0) { 583 isValid = false; 584 $("#" + $(captchadiv).attr("id")).append('<label class="error">' + LFValidations.recaptcha + '</label>'); 585 } 586 587 } 588 589 });
590 //password validate 591 $group.find('.Field.Password').each(function (i, item) { 592 var password = "", confirmpassword = ""; 593 $(item).find(':input').each(function (i, inputitem) { 594 if ($(inputitem).is(':visible')) { 595 $(inputitem).next('.conmessage').remove(); 596 if ($(inputitem).hasClass('password')) { 597 password = inputitem.value; 598 } 599 else if ($(inputitem).hasClass('confirmpassword')) { 600 $(inputitem).next('.conmessage').remove(); 601 confirmpassword = inputitem.value; 602 if (password != confirmpassword) { 603 focus.push(inputitem); 604 $('<label class="error conmessage">' + LFValidations.matchpassmessage + '</label>').insertAfter(inputitem); 605 isValid = false; 606 } 607 } 608 } 609 }); 610 611 }); 612 613 614 //validate Extension fields 615 isValid = ValidateExtension($group, focus, isValid); 616 617 if ($(focus).length > 0) { 618 $('html,body').animate({ scrollTop: $(focus).first().closest('li').first().offset().top - 100 }, 500, function () { $(focus).first().focus(); }); 619 //$(focus).first().focus(); 620 } 621 // If any fields failed validation, prevent the button's click 622 // event from triggering form submission. 623 if (!isValid) { 624 jQuery(".lfoverlay").hide(); 625 jQuery(".lfmodal").hide(); 626 evt.preventDefault(); 627 } 628 else if (evt.keyCode == 13) { 629 var SubmitButton = $group.find('.causesValidation.bSubmit'); 630 if (SubmitButton.length > 0) { 631 SubmitButton.click(); 632 evt.preventDefault(); 633 } 634 } 635 //else { 636 637 // var url = window.location.href; 638 // if (url.indexOf("?") > -1) 639 // url = url + '&mid=' + parseInt($(this).attr("mid")); 640 // else 641 // url = url + '?mid=' + parseInt($(this).attr("mid")); 642 643 // $.post(url, $('form').serializeArray()).done(function (data) { 644 // var $group = $(evt.currentTarget).parents('.validationGroup'); 645 // var SubmitButton = $group.find('.causesValidation.bSubmit'); 646 // jQuery(".lfoverlay").hide(); 647 // jQuery(".lfmodal").hide(); 648 // var html = $.parseHTML(data); 649 // var dom = $(data); 650 // $('body').find('[uniqueid="LiveForm' + parseInt($(SubmitButton).attr("mid")) + '"]').html(dom.find('[uniqueid="LiveForm' + parseInt($(SubmitButton).attr("mid")) + '"]').html()); 651 // $.each($(data).find('script'), function (k, v) { 652 // var src = $(v).attr("src"); 653 // if (src != undefined && src.indexOf("DesktopModules/LiveForms") != -1) { 654 // eval(v); 655 // } 656 // }); 657 // }) 658 // evt.preventDefault(); 659 //} 660}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.