-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform-under.jsp
executable file
·203 lines (171 loc) · 5.77 KB
/
form-under.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<div id="ace-settings-container">
<div class="btn btn-app btn-mini btn-warning" id="ace-settings-btn">
<i class="icon-cog"></i>
</div>
<div id="ace-settings-box">
<div>
<div class="pull-left">
<select id="skin-colorpicker" class="hidden">
<option data-class="default" value="#438EB9">#438EB9</option>
<option data-class="skin-1" value="#222A2D">#222A2D</option>
<option data-class="skin-2" value="#C6487E">#C6487E</option>
<option data-class="skin-3" value="#D0D0D0">#D0D0D0</option>
</select>
</div>
<span> Choose Skin</span>
</div>
<div>
<input type="checkbox" class="ace-checkbox-2" id="ace-settings-header" />
<label class="lbl" for="ace-settings-header"> Fixed Header</label>
</div>
<div>
<input type="checkbox" class="ace-checkbox-2" id="ace-settings-sidebar" />
<label class="lbl" for="ace-settings-sidebar"> Fixed Sidebar</label>
</div>
</div>
</div><!--/#ace-settings-container-->
</div><!--/#main-content-->
</div><!--/.fluid-container#main-container-->
<a href="#" id="btn-scroll-up" class="btn btn-small btn-inverse">
<i class="icon-double-angle-up icon-only bigger-110"></i>
</a>
<!--basic scripts-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
window.jQuery || document.write("<script src='assets/js/jquery-1.9.1.min.js'>"+"<"+"/script>");
</script>
<script src="assets/js/bootstrap.min.js"></script>
<!--page specific plugin scripts-->
<script src="assets/js/fuelux/fuelux.wizard.min.js"></script>
<script src="assets/js/jquery.validate.min.js"></script>
<script src="assets/js/additional-methods.min.js"></script>
<script src="assets/js/bootbox.min.js"></script>
<script src="assets/js/jquery.maskedinput.min.js"></script>
<script src="assets/js/chosen.jquery.min.js"></script>
<!--ace scripts-->
<script src="assets/js/ace-elements.min.js"></script>
<script src="assets/js/ace.min.js"></script>
<!--inline scripts related to this page-->
<script type="text/javascript">
$(function() {
$('[data-rel=tooltip]').tooltip();
$(".chzn-select").css('width','150px').chosen({allow_single_deselect:true , no_results_text: "No such state!"})
.on('change', function(){
$(this).closest('form').validate().element($(this));
});
var $validation = false;
$('#fuelux-wizard').ace_wizard().on('change' , function(e, info){
if(info.step == 1 && $validation) {
if(!$('#validation-form').valid()) return false;
}
}).on('finished', function(e) {
bootbox.dialog("感谢您的使用,请点击右侧的Continue按钮提交表单!", [{
"label" : "OK",
"class" : "btn-small btn-primary",
}]
);
//window.location.href='result.php';
});
$('#validation-form').hide();
$('#skip-validation').removeAttr('checked').on('click', function(){
$validation = this.checked;
if(this.checked) {
$('#sample-form').hide();
$('#validation-form').show();
}
else {
$('#validation-form').hide();
$('#sample-form').show();
}
});
//documentation : http://docs.jquery.com/Plugins/Validation/validate
$.mask.definitions['~']='[+-]';
$('#phone').mask('(999) 999-9999');
jQuery.validator.addMethod("phone", function (value, element) {
return this.optional(element) || /^\(\d{3}\) \d{3}\-\d{4}( x\d{1,6})?$/.test(value);
}, "Enter a valid phone number.");
$('#validation-form').validate({
errorElement: 'span',
errorClass: 'help-inline',
focusInvalid: false,
rules: {
email: {
required: true,
email:true
},
password: {
required: true,
minlength: 5
},
password2: {
required: true,
minlength: 5,
equalTo: "#password"
},
name: {
required: true
},
phone: {
required: true,
phone: 'required'
},
url: {
required: true,
url: true
},
comment: {
required: true
},
state: {
required: true
},
platform: {
required: true
},
subscription: {
required: true
},
gender: 'required',
agree: 'required'
},
messages: {
email: {
required: "Please provide a valid email.",
email: "Please provide a valid email."
},
password: {
required: "Please specify a password.",
minlength: "Please specify a secure password."
},
subscription: "Please choose at least one option",
gender: "Please choose gender",
agree: "Please accept our policy"
},
invalidHandler: function (event, validator) { //display error alert on form submit
$('.alert-error', $('.login-form')).show();
},
highlight: function (e) {
$(e).closest('.control-group').removeClass('info').addClass('error');
},
success: function (e) {
$(e).closest('.control-group').removeClass('error').addClass('info');
$(e).remove();
},
errorPlacement: function (error, element) {
if(element.is(':checkbox') || element.is(':radio')) {
var controls = element.closest('.controls');
if(controls.find(':checkbox,:radio').length > 1) controls.append(error);
else error.insertAfter(element.nextAll('.lbl').eq(0));
}
else if(element.is('.chzn-select')) {
error.insertAfter(element.nextAll('[class*="chzn-container"]').eq(0));
}
else error.insertAfter(element);
},
submitHandler: function (form) {
},
invalidHandler: function (form) {
}
});
})
</script>