电脑故障

位置:IT落伍者 >> 电脑故障 >> 浏览文章

根据ID填充文本框的实例代码


发布日期:2020/7/21
 

前台

复制代码 代码如下:
<script type="text/javascript">
function func_load_remark(sr_id){
if(sr_id!=){
$getJSON("loadSrRemarkdo?date="+new Date() {srid:sr_id} function(srmain){
$("#bparemark")val(srmainbpa_remark);
$("#itdremark")val(srmainitd_remark);
$("#bugremark")val(srmainbu_remark);
$("#itoremark")val(srmainito_remark);
});
}else{
$("#bparemark")val("");
$("#itdremark")val("");
$("#bugremark")val("");
$("#itoremark")val("");
}
}
function check(){
if($("#srid")val()==""){
alert("请选择SR_ID!");
$("#srid")focus();
return false;
}
return true;
}
</script>


后台

复制代码 代码如下:


package comaegon_cnoocoaadminaction;
import javaioPrintWriter;
import javaxservlet
import javaxservlet
import netsfjsonJSONSerializer;
import netsfjsonutilJSONUtils;
import orgapachestrutsactionActionForm;
import orgapachestrutsactionActionForward;
import orgapachestrutsactionActionMapping;
import comaegon_cnoocframeworkbaseactionBaseAction;
import comaegon_cnoocoaadminserviceUserService;
import comaegon_cnoocoaibatistoTuOafSrMainTO;
public class LoadSrRemarkAction extends BaseAction{
private UserService userService;
public ActionForward executeAction(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response)
throws Exception {
String srid=requestgetParameter("srid");
TuOafSrMainTO srMain=userServicegetRemarkBySrId(srid);
responsesetContentType("application/json;charset=gbk");
responsesetCharacterEncoding("gbk");
PrintWriter pw = responsegetWriter();
pwwrite(JSONUtilsvalueToString(JSONSerializertoJSON(srMain)));
pwflush();
return null;
}
public void setUserService(UserService userService) {
thisuserService = userService;
}
}

上一篇:固定表格行列(expression)在IE下适用

下一篇:使用闭包对setTimeout进行简单封装避免出错