﻿$(document).ready(function()
{ showWatermarks(); $(getJQueryID('ddlProgramCategoryMaster')).change(getProgramCategories); $(getJQueryID('ddlProgramCategory')).change(getDegrees); $("#aspnetForm").validate({ rules: { txtEmail: { email: true }, txtZip: { digits: true, minlength: 5, maxlength: 5} }, messages: { ddlProgramCategoryMaster: "*", ddlProgramCategory: "*", ddlDesiredDegree: "*", txtZip: { required: "* Zip Required", digits: "* Invalid Zip", minlength: "* Invalid Zip", maxlength: "* Invalid Zip" }, txtEmail: { required: "* Email Required", email: "* Invalid Email"} }, errorClass: "invalid", onfocusout: false, onkeyup: false }); }); function showWatermarks()
{ $('#txtZip').watermark('Zip code'); $('#txtEmail').watermark('Email address'); }
function getProgramCategories() {
    var programCategoryMasterId = $(getJQueryID('ddlProgramCategoryMaster')).val(); if (!programCategoryMasterId || programCategoryMasterId.length == 0) { programCategoryMasterId = '0'; }
    $.ajax({ type: "POST", url: "/services/CareerEducationResourceService.asmx/GetProgramCategoryList", data: "{'programCategoryMasterId':'" + programCategoryMasterId + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: bindProgramCategories });
}
function getDegrees() {
    var programCategoryId = $("#ddlProgramCategory").val(); if (!programCategoryId || programCategoryId.length == 0) { programCategoryId = '0'; }
    $.ajax({ type: "POST", url: "/services/CareerEducationResourceService.asmx/GetDegreeList", data: "{'programCategoryID':'" + programCategoryId + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: bindDegrees });
}
function bindProgramCategories(result)
{ bindResults("ddlProgramCategory", result.d); getDegrees(); }
function bindDegrees(result)
{ bindResults("ddlDesiredDegree", result.d); }