-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathformtest.php
56 lines (43 loc) · 1.91 KB
/
formtest.php
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
<form id='test-form'>
<div id="field5" style="display: none;">
<input type="radio" name="home" value="no" disabled>6no
<input type="radio" name="home" value="yes" disabled>6yes<br>
</div>
<div id="field6" style="display: block;">
<input onChange="getValueb(this)" type="radio" name="home" value="no" checked >5no
<input onChange="getValueb(this)" type="radio" name="home" value="yes">5yes<br>
</div>
<br/>
<div id="field4" style="display: none;">
<input type="radio" name="away" value="no" disabled>4no
<input type="radio" name="away" value="yes" disabled>4yes<br>
</div>
<div id="field3" style="display: block;">
<input onChange="getValuec(this)" type="radio" name="away" value="no" checked>3no
<input onChange="getValuec(this)" type="radio" name="away" value="yes">3yes<br>
</div>
</form>
<script type="text/javascript">
function getValueb(b) {
if(b.value == 'no'){
document.getElementById("field4").style.display = 'none'; // you need a identifier for changes
document.getElementById("field3").style.display = 'block'; // you need a identifier for changes
}
else{
document.getElementById("field4").style.display = 'block'; // you need a identifier for changes
document.getElementById("field3").style.display = 'none'; // you need a identifier for changes
}
}
</script>
<script type="text/javascript">
function getValuec(c) {
if(c.value == 'no'){
document.getElementById("field5").style.display = 'none'; // you need a identifier for changes
document.getElementById("field6").style.display = 'block'; // you need a identifier for changes
}
else{
document.getElementById("field5").style.display = 'block'; // you need a identifier for changes
document.getElementById("field6").style.display = 'none'; // you need a identifier for changes
}
}
</script>