Search code examples
javascripthtmljspauditing

how to disable autocomplete on in jsp page


i have jsp page it have username and password.if we fill up username and password and click on submit button then the browser asks Remember password then click on that it stores username and password.i donot want to store username and password in browser.i have use the autocomplete=off in jsp .

<form name="indexFrm" id="indexFrm" autocomplete="off" method="post">

<!DOCTYPE html> 
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Login</title>
<script src="http://code.jquery.com/jquery-1.11.min.js"></script>

<script type="text/javascript">




function login(btnName)
{


  if(window.document.indexFrm.userIdTxt.value=="")
    {
        alert("Enter User Id");
        window.document.indexFrm.userIdTxt.focus();
        return false;
    }
     if(window.document.indexFrm.pwdTxt.value=="")
    {
        alert("Enter Password");
        window.document.indexFrm.pwdTxt.focus();
        return false;
    }else{
   window.document.indexFrm.action = "../epay/abcd.jsp";
   document.indexFrm.method='post';
   window.document.indexFrm.submit();
  }

}



</script>

</head>

<body topmargin="0" leftmargin="0" background="../images/background.gif" onLoad = 'window.document.indexFrm.userIdTxt.focus();'>
<div id="wrapper">
  <form name="indexFrm" id="indexFrm" autocomplete="off" method="post">
<table width="971" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="100%" height="15" style="padding-right:4">
      <div align="right">
        <table border="1" width="10%" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF">
          <tr>
<td width="50%" height="22" bgcolor="#3F9DE5">
                                                <p align="center"><a href="../htmlpages/mainbottom.htm" target="" class="newrightbtn">Home</a> </td>
          </tr>
        </table>
      </div>    </td>
  </tr>
  <tr>
    <td width="100%" height="15"></td>
  </tr>
  <tr>
    <td width="100%">
      <div align="center">
        <center>
        <table border="1" width="60%" bordercolor="#7CC8FA" cellspacing="0" cellpadding="0">
          <tr>
            <td width="100%">
              <table width="100%" border="0" cellpadding="0" cellspacing="1" class="newtexts">
                <tr>
                  <td width="100%" bgcolor="#ABDCFC" colspan="2" height="20">
                    <p align="center" class="newhead">LOGIN</td>
                </tr>
                <tr>
                  <td width="100%" bgcolor="#D6EEFE" colspan="2" height="21">&nbsp;</td>
                </tr>
                <tr>
                  <td width="42%" bgcolor="#D6EEFE" align="right">User
                              Id&nbsp; </td>
                  <td width="58%" bgcolor="#D6EEFE"><input type="text" name="userIdTxt" size="20" autocomplete="off"></td>
                </tr>
                <tr>
                  <td width="42%" bgcolor="#D6EEFE" align="right">Password&nbsp;
                              </td>
                  <td width="58%" bgcolor="#D6EEFE"><input type=password name="pwdTxt" id="pwdTxt" size="20" autocomplete="off"></td>
                </tr>

                <td width="100%" colspan="2"><input name="stdSubBtn" type="button" class="newtexts" style="font-family: MS Sans Serif; font-size: 8pt; font-weight: bold"  onClick = 'login(this.name);' ></td>




</table>
<input type="hidden" name="frmName" value="indexFrm">
</form>
</div>
</body>
</html>

Solution

  • Autocomplete works on HTML5.0, I think you are using below to that, just change your doctype tag to

    <!DOCTYPE html>
    

    Then try.