-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex-7.html
143 lines (134 loc) · 6.37 KB
/
index-7.html
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
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Задание</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="img/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
<meta name="description" content="Your description">
<meta name="keywords" content="Your keywords">
<meta name="author" content="Dmitry Shamin">
<link rel="stylesheet" href="js/jquery-upload-file.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/preview.css">
<script src="js/include_script.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<link href="css/ie.css" rel="stylesheet">
<![endif]-->
</head>
<body>
<!--content wrapper-->
<div id="wrapper">
<section class="container">
<div class="dynamicContent">
<!--content-->
<div class="inner">
<div class="row">
<div class="span7 offset5">
<h4>Форма участника конкурса</h4>
<p>Для подачи своих работ на кокурс заполните форму ниже. Обратите внимание, что поля год
рождения, курс и e-mail являются обязательными. На кокурс можно подавать до 10 файлов,
каждый размером не более 5Мб.</p>
<form id="form1">
<label class="name pull-left">
<input type="text" name="name" value="Фамилия и имя:">
<span class="empty">*Это обязательное поле.</span> </label>
<label class="pull-left">
<select id="year" name="year"></select>
<script>
for(var i=1990;i<=2000;i++) {
$("#year").append( $('<option value="' + i + '">' + i + '</option>'));
}
</script>
<span class="empty">*Это обязательное поле.</span> </label>
<label class="vuz pull-left">
<input type="text" name="vuz" value="ВУЗ:">
</label>
<label class="pull-left">
<select id="kurs" name="kurs">
<option>1 курс</option>
<option>2 курс</option>
<option>3 курс</option>
<option>4 курс</option>
<option>5 курс</option>
<option>6 курс</option>
</select>
</label>
<label class="phone pull-left">
<input type="text" name="phone" value="Телефон:">
</label>
<label class="email pull-left">
<input type="text" name="email" value="E-mail:">
<span class="empty">*Это обязательное поле.</span> </label>
<label class="message pull-left">
<textarea name="message">Комментарий:</textarea>
</label>
<div class="clearfix"></div>
<div id="fileuploader">Загрузить файлы</div>
</form>
<p class="">
</p>
</div>
</div>
<div class="row">
<br/><br/><br/>
<div class="span7 offset5">
<a href="http://students.autodesk.ru/"><img src="img/autodesk.gif" title="Студенческое сообщество Autodesk"><br/>
Студенческое сообщество Autodesk</a>
</div>
</div>
</div>
</div>
</section>
</div>
<script src="js/bootstrap.js"></script>
<script type="text/javascript">
jQuery('#form1').forms();
</script>
<script>
$(document).ready(function()
{
var filenames = [];
$("#fileuploader").uploadFile({
multiple:true,
url:"upload.php",
fileName:"myfile",
maxFileCount:10,
maxFileSize: 5 * 1024 * 1024,
dynamicFormData: function()
{
var form = $('#form1').serializeArray();
var data = {};
for (var i in form) {
if (form[i].name == 'name' && (form[i].value == 'Фамилия и имя:' || form[i].value == '')) {
alert('Необходимо указать фамилию и имя');
throw new Error("stop");
}
if (form[i].name == 'email' && (form[i].value == 'E-mail:' || form[i].value == '')) {
alert('Необходимо указать e-mail');
throw new Error("stop");
}
data[form[i].name] = form[i].value;
}
return data;
},
onError: function(files, status, errMsg, xhr) {
var obj = $.parseJSON(xhr.responseText);
alert(obj.error);
},
onSuccess: function(files, data, xhr) {
var obj = $.parseJSON(data);
filenames.push(obj[0]);
},
afterUploadAll: function() {
alert('Анкета и файлы ' + filenames.join(', ') + ' успешно загружены!');
location.reload();
}
});
});
</script>
</body>
</html>