ejaz mirza

ejaz mirza

  • NA
  • 471
  • 45.3k

after loading the editlist() function its not calling other

Dec 5 2018 2:03 AM
 
 other functions not calling after loading the function
if i remove the edit list function all are working properly 
 
 
 
 
 
<script>
function edittestlist() {
 var numbers= ["Blood Test", "Suger Test"];
//var numbers = @Html.Raw(Json.Encode(Model.name));
for (var i = 0; i < numbers.length; i++) {
$('<option/>').val(numbers[i]).html(numbers[i]).appendTo('#select-to');
}
$("#select-to").append(option);
}
$(document).ready(function () {
var t= edittestlist();
$('#addtest').click(function () {
var dd = $("#TestName").val();
$('#select-to').append("<option value=" + dd + ">" + dd + "</option>");
$("#TestName").val('');
appoitmnttestlist();
});
function appoitmnttestlist() {
var x = document.getElementById("select-to");
var txt = '';
var i;
for (i = 0; i < x.length; i++) {
txt = txt + "," + x.options[i].text;
}
countries = [];
countries.push(txt);
countries.join(", ");
var dd = $('#testlist').val(countries);
}
$('#removetest').click(function () {
$('#select-to option:selected').each(function () {
$(this).remove();
appoitmnttestlist();
});
});
$(function () {
@foreach (var topic in ViewBag.testlist)
{
<text>
var val = '@topic.TestName'
var id='@topic.'
nodestext.push(val);
</text>
}
});
$.noConflict();
$("#TestName").autocomplete({
source: nodestext
});
});
</script>

Answers (3)