Bug bei Mitarbeiter behoben
This commit is contained in:
parent
c77e481f2f
commit
c71ce6e77e
|
|
@ -10,7 +10,7 @@
|
|||
{{ form|crispy }}
|
||||
<h6>Mitarbeiter hinzufügen</h6>
|
||||
<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">
|
||||
<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>
|
||||
|
|
@ -42,8 +42,27 @@
|
|||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
|
||||
var tempid = null;
|
||||
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(){
|
||||
$.ajax(
|
||||
{
|
||||
|
|
@ -114,18 +133,6 @@
|
|||
$("#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>
|
||||
{% endblock content %}
|
||||
|
|
|
|||
Loading…
Reference in New Issue