added some javascript

This commit is contained in:
nilsding 2014-08-18 17:28:14 +02:00
parent cdcfe20e37
commit 3d6915fac5
3 changed files with 10 additions and 5 deletions

View File

@ -2112,3 +2112,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
})
}(jQuery);
function a(b){
var c = document.getElementById("recent-count");
var d = document.getElementById("recent-btn");
c.disabled = d.disabled = b;
}

File diff suppressed because one or more lines are too long

View File

@ -19,15 +19,14 @@
</div>
<div class="checkbox">
<label>
<input id="recent_check" type="checkbox"> Showing Recent Answers
<input id="recent_check" type="checkbox" onchange="a(!this.checked)"> Showing Recent Answers
</label>
</div>
<!-- TODO: Javascript disabling this form if above checkbox is unchecked -->
<div class="form-group">
<label for="recent">Recent Answers</label>
<input type="number" class="form-control" id="recent_count" value="5" disabled>
<input type="number" class="form-control" id="recent-count" name="recent_count" value="5">
</div>
<button type="submit" class="btn btn-default">Submit</button>
<button type="submit" class="btn btn-default" id="recent-btn">Submit</button>
</form>
<hr/>
<form role="form">