PageSourceSearch

https://toupipe.com/templates/neapipe/js/appointment_ui_dialog.js

js toupipe.com collected 2026-09-27 06:50:27 UTC 2,032 bytes, 83 lines download raw bytes

1/**
2 * JavaScript/Ajax Samples
3 * @module jquery_ui_dialog
4 */
5var jquery_ui_dialog = {
6
7	errmes: undefined,
8	
9	onload: function() {
10		$('#formContact').bind('submit', function() {
11			jquery_ui_dialog.checkdata();
12			return jquery_ui_dialog.makeDialog();
13		});
14		$(':input').bind('blur', function() {
15			if ($(this).val().length > 0) $(this).removeClass('error');
16		});
17	},
18	
19	checkdata: function() {
20		jquery_ui_dialog.errmes = '';
21		$(':input').removeClass('error');
22		
23	
24			
25	 		
26				if (!$('#name').val().length > 0) {
27					jquery_ui_dialog.errmes += '請輸入姓名。<br />';
28					$('#name').addClass('error');
29				}
30				if (!$('#phone').val().length > 0) {
31					jquery_ui_dialog.errmes += '請輸入連絡電話。<br />';
32					$('#phone').addClass('error');
33				}
34				if (!$('#email').val().length > 0) {
35					jquery_ui_dialog.errmes += '請輸入email。<br />';
36					$('#email').addClass('error');
37				} else {
38					if($('#email').val().indexOf('@')<0) {
39						jquery_ui_dialog.errmes += '請輸入正確的電子郵箱地址!<br />';
40	 					$('#email').addClass('error');
41					}
42				}
43				
44				if (!$('#workdate').val().length > 0) {
45					jquery_ui_dialog.errmes += '請輸入施工日期<br>';
46					$('#workdate').addClass('error');
47				}
48				if (!$('#worktime').val().length > 0) {
49					jquery_ui_dialog.errmes += '請輸入施工時間<br>';
50					$('#worktime').addClass('error');
51				}
52				if (!$('#address').val().length > 0) {
53					jquery_ui_dialog.errmes += '請輸入地址<br>';
54					$('#address').addClass('error');
55				}
56			
57
58	},
59
60	makeDialog: function() {
61
62		if (!jquery_ui_dialog.errmes) return true;
63
64		$('<div/>')
65			.append($('<p/>')
66				.append(jquery_ui_dialog.errmes)
67			)
68			.dialog({
69				bgiframe: true,
70				modal: true,
71				title: '請輸入必填項目',
72				close: function() {
73					$(this).remove();
74				}
75			})
76		.appendTo('document.body');
77
78		return false;
79	}
80
81}
82
83$(function() { jquery_ui_dialog.onload(); });

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.