﻿function SetTrigger(a, b) { $(document).ready(function () { $(b + " .required span").each(function () { $(this).addClass("invisible") }); $(a).click(function (c) { $(b + " .required").each(function () { var d = $(this).prev(); if (d.val() == "") { $(d).addClass("required-error"); $(d).fadeOut("slow", function () { }); $(d).fadeIn("slow", function () { }); $(this).children().removeClass("invisible"); c.preventDefault() } else { $(d).removeClass("required-error"); $(this).children().addClass("invisible") } }) }) }) } function SetTrigger(b, d, c, a) { $(document).ready(function () { $(d + " .required span").each(function () { $(this).addClass("invisible") }); $(b).click(function (f) { var e = false; $(d + " .required").each(function () { var g = $(this).prev(); if (g.val() == "" || g.val() == -1) { e = false; $(g).addClass("required-error"); $(g).fadeOut("slow", function () { }); $(g).fadeIn("slow", function () { }); $(this).children().removeClass("invisible"); f.preventDefault(); if (c != null) { c() } } else { $(g).removeClass("required-error"); $(this).children().addClass("invisible"); e = true } }); if (e == true) { if (a != null) { a() } } }) }) };

