File size: 3,115 Bytes
4949db9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
{% extends "base.html" %}

{% block title %}Basic Information — Video Rating System{% endblock %}

{% block content %}
<div class="container">
  <div class="demographics-box">
    <h3>Basic Information</h3>
    <p>Background information for internal use only.</p>
    <form action="/demographics" method="POST" class="demographics-form">
      <div class="demo-field">
        <label class="demo-label">Gender <span class="required">*</span></label>
        <div class="demo-options">
          <label><input type="radio" name="gender" value="male" required> Male</label>
          <label><input type="radio" name="gender" value="female"> Female</label>
          <label><input type="radio" name="gender" value="other"> Other</label>
          <label><input type="radio" name="gender" value="prefer_not_to_say"> Prefer not to say</label>
        </div>
      </div>
      <div class="demo-field">
        <label class="demo-label">Age <span class="required">*</span></label>
        <select name="age" class="demo-input" style="width:240px" required>
          <option value="" disabled selected>Select</option>
          <option value="under18">Under 18</option>
          <option value="18-22">18–22</option>
          <option value="22-25">22–25</option>
          <option value="26-30">26–30</option>
          <option value="31-40">31–40</option>
          <option value="41+">41+</option>
        </select>
      </div>
      <div class="demo-field">
        <label class="demo-label">Major <span class="required">*</span></label>
        <div class="demo-options">
          <label><input type="radio" name="major" value="CS" required> Computer Science</label>
          <label><input type="radio" name="major" value="EE"> Electrical and Computer Engineering</label>
          <label><input type="radio" name="major" value="Business"> Business</label>
          <label><input type="radio" name="major" value="other"> Other:</label>
          <input type="text" name="major_other" class="demo-input demo-input-inline" placeholder="Please specify" disabled>
        </div>
      </div>
      <div class="demo-field">
        <label class="demo-label">Highest education (including pursuing) <span class="required">*</span></label>
        <select name="education" class="demo-input" style="width:240px" required>
          <option value="" disabled selected>Select</option>
          <option value="bachelor">Bachelor</option>
          <option value="master">Master</option>
          <option value="phd">PhD</option>
        </select>
      </div>
      <script>
        document.querySelectorAll('input[name="major"]').forEach(function(r) {
          r.addEventListener('change', function() {
            var otherInput = document.querySelector('input[name="major_other"]');
            otherInput.disabled = this.value !== 'other';
            if (this.value === 'other') otherInput.focus();
            else otherInput.value = '';
          });
        });
      </script>
      <button type="submit" class="btn btn-primary btn-start">Continue</button>
    </form>
  </div>
</div>
{% endblock %}