Home > front end >  Front desk after modified form, has a chance not popup tooltip (no successful box, no failure box),
Front desk after modified form, has a chance not popup tooltip (no successful box, no failure box),

Time:01-10

 & lt; ! DOCTYPE html> 


<meta charset="utf-8" & gt;
Layui
<meta name="the renderer" content="its" & gt;
<meta HTTP - equiv="X - UA - Compatible" content="IE=edge, chrome=1" & gt;
<meta name="viewport" content="width=device - width, initial - scale=1, maximum - scale=1" & gt;
<link rel="stylesheet" href="https://bbs.csdn.net/layui/css/layui.css" media="all" & gt;
<script SRC="https://bbs.csdn.net/js/jquery.js" charset="utf-8" & gt; </script>
$.get (" http://localhost:8888/kude/student/islogin ", function (data, status) {
//async: false,//keep ajax synchronous requests, the default for asynchronous
If (datahttps://bbs.csdn.net/topics/=='0') {
Location. A href="https://bbs.csdn.net/topics/login.html";
} else {
//alert (" login succeeds ");
}
});
$(function () {
$(" # submit "). Click (function () {
Var ssid=$(" # sid "). Val ();
Var name=$(" # sname "). Val ();
Var PWD=$(" # spassword "). Val ();
Var x=$(" # ssex "). Val ();
Var reiss=$(" # saddress "). Val ();
Var phone=$(" # stelphone "). Val ();
Var index=parent. Layer. GetFrameIndex (window. Name);
If ((the name!==null& & The name!=' ') & amp; & (PWD!==null& & The PWD!=' ') & amp; & (x!==null& & x!=' ') & amp; & (reiss!==null& & Reiss!=' ') & amp; & (phone!==null& & Phone!=' ')) {
$.post (" http://localhost:8888/kude/student/updata ", {
Id: ssid,
Stuname: name,
Password: the PWD,
Sex: x,
Address: reiss,
Telphone: phone,
},
Function (data, status) {
If (data!=null) {
Alert (data);
Alert (" success ");
//the window. The location. The close ();//close
parent.layer.close(index);//close the pop up layer
The parent. The location. Reload ();//update the parent page
} else {
Confirm (" modify the failure, to modify ");
Location. A href="https://bbs.csdn.net/topics/updata.html";
}
});
}
});
});
/* function close () {
Var a=$(" # xiugai "). Val (" yes ");
Alert (a);
} */
</script>

<body>

Student information changes & lt;/legend>


















- & gt;




<script SRC="https://bbs.csdn.net/layui/layui.js" charset="utf-8" & gt; </script>
<script>
Layui. Use ([' form ', 'layedit', 'laydate], function () {
Var form=layui. Form
, layer=layui layer
, layedit=layui layedit
, laydate=layui. Laydate;
//listen to submit
Form. On (' submit (not) ', function (data) {
Layer. Alert (JSON. Stringify (data field), {
Title: 'final submit information'
})
return false;
});
});
</script>





The background code:

 @ PostMapping ("/updata ") 
nullnullnullnullnullnull
  • Related