summaryrefslogtreecommitdiff
path: root/create.html
blob: f1cc31bd500abd8ce114afded282bd7ed29b1e86 (plain)
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
<style>
input:disabled + span { color: gray; }
</style>
<p>
Player count:
<br>
<select name="players">
<option value="">4 Player</option>
<option value="3">3 Player</option>
<option value="2">2 Player</option>
</select>

<p>
<label>
<input type="checkbox" value="true" name="emperor">Optional Emperor Rules
</label>

<p>
<label>
<input type="checkbox" value="true" name="no_demagogue" disabled><span>No Demagogue</span>
</label>

<script>
document.querySelector("select[name='scenario']").onchange = function (event) {
	let input = document.querySelector("input[name='no_demagogue']")
	if (/Expansion/.test(event.target.value)) {
		input.removeAttribute("disabled")
	} else {
		input.setAttribute("disabled", true)
		input.checked = false
	}
}
</script>