Tipp4 Modification behaviour: Disable OK when no joker set
This commit is contained in:
parent
77418b583e
commit
0ae7f6e361
1 changed files with 7 additions and 2 deletions
|
|
@ -98,7 +98,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<p> </p>
|
||||
<button type="submit" class="btn btn-primary">Ok</button>
|
||||
<button type="submit" id="btn_submit" class="btn btn-primary">Ok</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
|
@ -112,13 +112,15 @@
|
|||
let checkbox2=document.getElementById('joker_2')
|
||||
let checkbox3=document.getElementById('joker_3')
|
||||
let checkbox4=document.getElementById('joker_4')
|
||||
let btn_submit=document.getElementById('btn_submit');
|
||||
|
||||
if (checkbox1.checked==0 && checkbox2.checked==0 && checkbox3.checked==0 && checkbox4.checked==0) {
|
||||
checkbox1.checked=1;
|
||||
btn_submit.disabled=true;
|
||||
}
|
||||
|
||||
checkbox1.addEventListener('change', function() {
|
||||
if (this.checked) {
|
||||
btn_submit.disabled=false;
|
||||
checkbox2.checked=0;
|
||||
checkbox3.checked=0;
|
||||
checkbox4.checked=0;
|
||||
|
|
@ -131,6 +133,7 @@
|
|||
|
||||
checkbox2.addEventListener('change', function() {
|
||||
if (this.checked) {
|
||||
btn_submit.disabled=false;
|
||||
checkbox1.checked=0;
|
||||
checkbox3.checked=0;
|
||||
checkbox4.checked=0;
|
||||
|
|
@ -143,6 +146,7 @@
|
|||
|
||||
checkbox3.addEventListener('change', function() {
|
||||
if (this.checked) {
|
||||
btn_submit.disabled=false;
|
||||
checkbox1.checked=0;
|
||||
checkbox2.checked=0;
|
||||
checkbox4.checked=0;
|
||||
|
|
@ -154,6 +158,7 @@
|
|||
});
|
||||
checkbox4.addEventListener('change', function() {
|
||||
if (this.checked) {
|
||||
btn_submit.disabled=false;
|
||||
checkbox1.checked=0;
|
||||
checkbox2.checked=0;
|
||||
checkbox3.checked=0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue