Bug bei Mitarbeiter behoben
This commit is contained in:
parent
c77e481f2f
commit
c71ce6e77e
|
|
@ -10,7 +10,7 @@
|
||||||
{{ form|crispy }}
|
{{ form|crispy }}
|
||||||
<h6>Mitarbeiter hinzufügen</h6>
|
<h6>Mitarbeiter hinzufügen</h6>
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<input class="form-control" list="usersfree" name="searchusers" id="searchusers" type="text" onkeyup="javascript:checkValue()">
|
<input class="form-control" list="usersfree" name="searchusers" id="searchusers" type="text" onkeyup="javascript:checkSearchUser()">
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button type="button" id="addusertotaskbtn" onclick="javascript:addUserToTask()" class="btn btn-success" disabled>Mitarbeiter hinzufügen</button>
|
<button type="button" id="addusertotaskbtn" onclick="javascript:addUserToTask()" class="btn btn-success" disabled>Mitarbeiter hinzufügen</button>
|
||||||
<button type="button" onclick="javascript:clearSearchfield()" class="btn btn-secondary" ><i class="fas fa-times"></i></button>
|
<button type="button" onclick="javascript:clearSearchfield()" class="btn btn-secondary" ><i class="fas fa-times"></i></button>
|
||||||
|
|
@ -42,8 +42,27 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var tempid = null;
|
var tempid = null;
|
||||||
var tempcounter = 0;
|
var tempcounter = 0;
|
||||||
|
|
||||||
|
//Check for valid input on inputfield
|
||||||
|
function checkSearchUser()
|
||||||
|
{
|
||||||
|
var g = $('#searchusers').val();
|
||||||
|
var id = $('#usersfree').find('option[value="' + g + '"]').attr('id');
|
||||||
|
if(id != undefined && id.length > 0){
|
||||||
|
tempid = id;
|
||||||
|
$("#addusertotaskbtn").prop('disabled', false);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
tempid = null;
|
||||||
|
$("#addusertotaskbtn").prop('disabled', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function addUserToTask(){
|
function addUserToTask(){
|
||||||
$.ajax(
|
$.ajax(
|
||||||
{
|
{
|
||||||
|
|
@ -114,18 +133,6 @@
|
||||||
$("#addusertotaskbtn").prop('disabled', true);
|
$("#addusertotaskbtn").prop('disabled', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check for valid input on inputfield
|
|
||||||
function checkValue(){
|
|
||||||
var g = $('#searchusers').val();
|
|
||||||
var id = $('#usersfree').find('option[value="' + g + '"]').attr('id');
|
|
||||||
if(id != undefined && id.length > 0){
|
|
||||||
tempid = id;
|
|
||||||
$("#addusertotaskbtn").prop('disabled', false);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
tempid = null;
|
|
||||||
$("#addusertotaskbtn").prop('disabled', true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue