"); $.get("/JQAP/FinanceFormVehicleHandler.ashx", { Function: "DealerStock_get_makes", Dealer: dealerID, Department: type, ShowMakes: showMakes }, function (data) { $("[id*='ddlMake']").html(data); $("[id*='ddlMake']").removeAttr("disabled"); }).error(function (xhr, error, msg) { $("[id*='ddlMake']").html(original); console.log("AJAX ERROR: " + error + ", " + msg); }); } function GetFormModels() { var showModels = $("[id*='hfModel']").val(); var dealerID = "67"; var type = $("#formDepartment").val(); var makeID = $("[id*='ddlMake']").val(); var original = $("[id*='ddlModel']").html(); if (makeID > 0 || makeID != "") { $("[id*='ddlModel']").html(" Loading... "); $.get("/JQAP/FinanceFormVehicleHandler.ashx", { Function: "DealerStock_get_list_of_models", ID: makeID, Dealer: dealerID, Department: type, ShowModels: showModels }, function (data) { $("[id*='ddlModel']").html(data); $("[id*='ddlModel']").removeAttr("disabled"); }).error(function (xhr, error, msg) { $("[id*='ddlModel']").html(original); console.log("AJAX ERROR: " + error + ", " + msg); }); } else { $("[id*='ddlModel']").html("Select a Make First").attr('disabled', 'disabled'); $("[id*='ddlVariant']").html("Select a Model First").attr('disabled', 'disabled'); $("[id*='ddlVehicle']").html("Select a Variant First").attr('disabled', 'disabled'); } } function GetFormVariants() { var dealerID = "67"; var type = $("#formDepartment").val(); var modelID = $("[id*='ddlModel']").val(); var original = $("[id*='ddlVariant']").html(); if (modelID > 0 || modelID != "") { $("[id*='ddlVariant']").html(" Loading... "); $.get("/JQAP/FinanceFormVehicleHandler.ashx", { Function: "DealerStock_get_list_of_variants", ID: modelID, Dealer: dealerID, Department: type }, function (data) { $("[id*='ddlVariant']").html(data); $("[id*='ddlVariant']").removeAttr("disabled"); }).error(function (xhr, error, msg) { $("[id*='ddlVariant']").html(original); console.log("AJAX ERROR: " + error + ", " + msg); }); } else { $("[id*='ddlVariant']").html("Select a Model First").attr('disabled', 'disabled'); $("[id*='ddlVehicle']").html("Select a Variant First").attr('disabled', 'disabled'); } }; function GetFormVehicles() { var dealerID = "67"; var type = $("#formDepartment").val(); var variantID = $("[id*='ddlVariant']").val(); var original = $("[id*='ddlVehicle']").html(); if (variantID > 0 || variantID != "") { $("[id*='ddlVehicle']").html(" Loading... "); $.get("/JQAP/FinanceFormVehicleHandler.ashx", { Function: "DealerStock_get_vehicles", ID: variantID, Dealer: dealerID, Department: type }, function (data) { $("[id*='ddlVehicle']").html(data); $("[id*='ddlVehicle']").removeAttr("disabled"); }).error(function (xhr, error, msg) { $("[id*='ddlVehicle']").html(original); console.log("AJAX ERROR: " + error + ", " + msg); }); } else { $("[id*='ddlVehicle']").html("Select a Variant First").attr('disabled', 'disabled'); } }; function validateCaptcha(field, rules, i, options) { var Resp = "Please enter the correct value"; var pRand = (Math.floor((Math.random() * 10000000000) + 1) % 1000); var controlValue = $('.am-i-human input', $(field).parents('.form-builder-container:first')).val(); var itemValue = ""; if (field != null && field !=='undefined') { itemValue = field.val() } $.ajax({ async: false, type: "POST", url: "/JQAP/Forms.ashx", data: { AJAXClick: "validatecaptcha", UserEntry: itemValue, ControlValue: controlValue, Rand: pRand }, success: function (resp) { Resp = resp; } }); if (Resp != "ok") { return Resp; } } function validateUploader(field, rules, i, options) { var Resp = "Please upload the required files"; var pRand = (Math.floor((Math.random() * 10000000000) + 1) % 1000); if (Forms87195UploadItems.length < 1) { return Resp; } } $(document).ready(function () { GetFormMakes(); });