PageSourceSearch

https://pasadena.edu/_resources/js/ouforms.js

js pasadena.edu collected 2026-09-24 06:24:03 UTC 4,525 bytes, 156 lines download raw bytes

1jQuery(document).ready(function($) {
2//$(window).load(function () {
3
4	$("input:text").on('input', function () {
5		$(this).next('.label-important:first').remove();
6		return false;
7	});
8
9	$("textarea").on('input', function () {
10		$(this).next('.label-important:first').remove();
11		return false;
12	});
13
14	$("select").change(function () {
15		if($(this).val() !== ''){
16			$(this).next('.label-important:first').remove();
17			return false;
18		};
19	});
20
21	$(":checkbox").change(function(){
22		$(this).parents('.controls').next('.label-important:first').remove();
23		return false;
24	});
25
26	$(":radio").change(function(){
27		$(this).parents('.controls').next('.label-important:first').remove();
28		return false;
29	});
30
31	$("input.datetime[type='text']").change(function () {
32		$(this).next('.label-important:first').remove();
33		return false;
34	});
35
36	$("[type='submit']")
37	  .filter(function () {
38		return !$(this).closest("form").is("#form-1234");
39	  })
40	  .off("click")
41	  .on("click", function () {
42		var f_element = $(this);
43		var bid = f_element.attr("id");
44		var toRemove = 'btn_';
45		var skid = bid.replace(toRemove, '');
46		var form_data = $("#forms_" + skid).serialize();
47
48		$("#form_" + skid).off('submit').on('submit', function (e) {
49			e.preventDefault();
50			$("#btn_"+skid).hide();
51
52			$("#form_" + skid).append("<span id='spin'> <img src='/_resources/images/ldp/loading.gif' height='50' width='50'></img> Submitting, Please Wait .. </span>");
53
54			// disable submit while waiting for server response, to prevent multiple submissions
55			$("#btn_"+skid).hide();
56			$("#clr_"+skid).hide();
57
58			$("#form_" + skid + ".label-important").remove();
59
60			if ($("#form_" + skid + " #hp"+ skid ).val().length > 0) {
61
62			} else {
63
64				$.ajax({
65					type: "POST",
66					cache: false,
67					url: "/_resources/php/forms.php", //form_submit.aspx
68					data: $(this).serialize(),
69					success: function (data) {
70						var resultObj = jQuery.parseJSON(data);
71						var errC = /[faultcode]+\s:/;
72						var faultCode = errC.exec(resultObj.message);
73						if (resultObj.active == false) {
74							if (! this.faultCode) {
75								$("#status_" + skid).addClass("alert alert-error");
76								var dataSet = resultObj.message + "<br/>";
77								$.each(resultObj.data, function (i, data) {
78									var d = data.message;
79									highlightID = "#id_" + data.name;
80									errorHTML = '<span style="margin-left:8px;" class="label label-important" id="' + data.name + 'Error">' + data.message + '<br/></span>';
81									if ($('#' + data.name + 'Error').length == 0) {
82										$(highlightID).after(errorHTML);
83									}
84								});
85								$("#status_" + skid).html(dataSet);
86
87								// re-enable submit button, so that user may fix errors and try again
88
89								$("#btn_"+skid).show();
90								$("#clr_"+skid).show();
91								$("#spin").remove();
92							} else {
93								var dataSet = resultObj.message + " " + resultObj.data[0].message;
94								$("#status_" + skid).addClass("alert alert-error");
95								$("#status_" + skid).html(dataSet);
96								$(document).scrollTop($("#status_" + skid).offset().top);
97
98							}
99						} else {
100							if(typeof redirectPath != 'undefined' && redirectPath != ''){ //check if there is a url to redirect to when the form is submitted
101								window.location.href = redirectPath;
102							}else{
103								$("#status_" + skid).removeClass("alert alert-error");
104								$("#status_" + skid).addClass("alert alert-success");
105
106								$("#form_" + skid).remove();
107								$("#status_" + skid).html(resultObj.message);
108								$(document).scrollTop($("#status_" + skid).offset().top);
109							}
110						}
111					},
112					error: function (data) {
113					}
114				});
115				return false;
116			}
117		});
118	});
119
120	//	date/time picker configs
121
122	if(typeof OUC !== "undefined" && typeof OUC.dateTimePickers !== "undefined"){
123
124		$.datetimepicker.setLocale('en');
125
126		$(OUC.dateTimePickers).each(function(index, options){
127
128			if(options.format == "datetime"){
129				$(options.id).datetimepicker({
130										value: options.default,
131										format: 'm/d/y g:i A',
132										formatTime: 'g:i A',
133										step: 15
134									});
135			}
136			else if(options.format == "date"){
137				$(options.id).datetimepicker({
138										value: options.default,
139										timepicker:false,
140										format:'m/d/Y',
141										step: 15
142									});
143			}
144			else if(options.format == "time"){
145				$(options.id).datetimepicker({
146										value: options.default,
147										datepicker:false,
148										format:'g:i A',
149										formatTime: 'g:i A',
150										step: 15
151									});
152			}
153		});
154	}
155
156});

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.