简体   繁体   English

在Asp.Net MVC5中的模糊事件上更新文本框值

[英]Update TextBox Value on Blur Event in Asp.Net MVC5

I have employees particulars in tabular form. 我有表格形式的员工资料。 I want to update the cell number of the employees so that I populate that number in TextBox in Table Cell .. how can I save that number to datatbase when onblur event fire... 我想更新员工的单元格编号,以便在表格单元格的文本框中填充该编号。.onblur事件触发时,如何将该编号保存到数据库中?

$("#Mobile").blur(function UpdateEmployeeMobile() {
var MobileNo = $("#Mobile").val();    
var EMPLOYEEID = $("#StudentID").val();    
var ID = EMPLOYEEID + "-" + MobileNo;    
$.post("/Employee/UpdateMobile/" + ID, null, function (data) {    
});    
});

try this: 尝试这个:

$("#Mobile").blur(function() {
  var MobileNo = $(this).val();    
  var EMPLOYEEID = $("#StudentID").val();    
  var ID = EMPLOYEEID + "-" + MobileNo;    
  $.post("/Employee/UpdateMobile/" + ID, status, function (data) {  
     ...  
  });    
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM