jquery Code
The code is as follows |
Copy Code |
<script language= "javascript" >/* Rebate Process * * $ (' #ajaxpassword '). Click (function () { alert (' BB '); Checkem (); var postdata = $ (' #pwdmsg '). Serialize (); alert (postdata); $.ajax ({ Type: "POST", URL: "update.php", Data:postdata, Success:function (msg) { Alert (msg); if (msg==1) { Alert (' Password modification successful, please remember your new password! '); location.href= ' http://www.111cn.net ';
}else{ Alert (msg); } } }); }) </script> Html |
<!--Modify Password-->
The code is as follows |
Copy Code |
<div id= "Passworddiv" > <form id= "pwdmsg" name= "pwdmsg" > <div class= "Aui_outer" > <table class= "Aui_border" > <tr> <TD class= "AUI_NW" ></td> <TD class= "Aui_n" ></td> <TD class= "Aui_ne" ></td> </tr> <tr> <TD class= "Aui_w" ></td> <TD class= "Aui_c" > <div class= "Aui_inner" > <div class= "Close_lay" ><a href= "Javascript:closela" (' Passworddiv '); " ></a></div> <div class= "Aui_title" > Modify password </div> <div class= "Aui_content" > <table width= "100%" border= "0" cellspacing= "0" cellpadding= "0" > <tr> <TD class= "Td_1" > Old login Password:</td> <td><input name= "Oldpwd" class= "text text_w2" type= "password" id= "Oldpwd" ></td> </tr> <tr> <TD class= "Td_1" > New login Password:</td> <td><input name= "newpwd" type= "password" class= "text text_w2" id= "Newpwd" size= "> " Password length 6-12 character composition </td> </tr> <tr> <TD class= "Td_1" > Confirm New Password:</td> <td><input name= "newpwd1" type= "password" class= "text text_w2" id= "Newpwd1" size= "></td>" </tr> </table> </div> <div class= "aui_jtqx" ><input type= "button" name= "" value= "Save Password" class= "aui_tjbtn" id= "Ajaxpassword"/> <input name= "Action" type= "hidden" value= "6" > </div> </div></td> <TD class= "Aui_e" ></td> </tr> <tr> <TD class= "AUI_SW" ></td> <TD class= "aui_s" ></td> <TD class= "Aui_se" style= "cursor:se-resize;" ></td> </tr> </table> </div> </form> </div> |
update.php
This file is to use the Post method to accept AJAX data and then update, note: Ajax coding is uft8 if you are GBK page We do character encoding conversion can