Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dual action submission form help

Status
Not open for further replies.
Jun 11, 2007
5
US
Hello,

I am working on making a form that contains two submit buttons that, when pressed, each dynamically change the action of the form. Essentially the form has the customer enter their login information for their e-mail on our site. Since we have a junk mail filter also, and we use the same login information for each, I am trying to setup one form with two buttons allowing the user to log into which ever service they would like. I have everything working correctly except the way that our junk mail service has you log in. It's hard to explain, but here is a link to the login page for their service.


Our webmail service just does a plain "POST" to a perl script to login. I am having troubles understanding how our junk mail service does their login. Any help is greatly appreciated!

-Casey
 
You can state the action in the buttons to be different, that's just HTML. Make the buttons type submit and set the action for each one.

Cheers,
Dian
 
The switching of the actions depending on the button pushed isn't my main problem. The main issue I am having is understanding how the login works for our 3rd party junk mail filter site:
I know understand javascript somewhat, but the login sequence that this site uses doesn't make sense to me. Thank you.
 
Hi

Well, as we do not have access to those pages, you may tell us whaich third party junk mail filter you use, so we could at least take a look in its documentation... Maybe it uses HTTP authentication ( as described in RFC2617 ).

Feherke.
 
Here is the source for the page in question. The part that I don't understand is the form part. Sorry for posting so much code. Thanks.

Code:
<html>
<head>
  <title>Log in</title>
</head>
<body bgcolor="#FFFFFF">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
  <tr background="/images/grayBars.gif" width="100%">
    <td align="right" background="" width="100%">
      <img src="/images/dotClear.gif" height="32" border="0">
    </td>

  </tr>
</table>

<script language="JavaScript"><!--
function email_Submit() {
  document.password.pword.focus();
  return false;
}
function password_Submit() {
  document.password.email.value = document.login.email.value;
  return true;
}
// --></script>

<center>
<table cellspacing="5" cellpadding="0" border="0" width="500">
  <tr>
    <td colspan="2" valign="top">
      <font face="Arial, Helvetica, sans-serif">
      <font size="+2"><b>Log in to your message center.</b></font>

      <br><br>
      <font color="#CC0000"><b></b></font>
      <p>
      <font color="#CC0000" size="-1"><b></b></font>
   </td>
  </tr>
  <form name="login" action="[URL unfurl="true"]https://login.postini.com/exec/login"[/URL] method="post" onSubmit="return email_Submit();">
  <tr>
    <td valign="middle" align="right">

      <font face="Arial, Helvetica,sans-serif" size="-1">
      <b>Log in Address</b>
      </font>
      </td>
    <td valign="bottom">
      <input type="text" name="email" size="29" value="">
      </td>
  </tr>

  <tr>
    <td valign="top"></td>
    <td valign="top">
      <font face="Arial, Helvetica,sans-serif" size="-1">
      example: joe234@jumbowidgetsco.com
      </font>
      </td>
  </tr>
<script language="JavaScript"><!--
document.write('<\/form><form name="password" action="[URL unfurl="true"]https://login.postini.com/exec/login"[/URL] method="post" onSubmit="return password_Submit();">');
document.write('<input type="hidden" name="email">');
// --></script>

  <tr>
    <td valign="middle" align="right">
      <font face="Arial, Helvetica,sans-serif" size="-1">
      <b>Password</b>
      </font>
      </td>
    <td valign="bottom">
      <input type="password" name="pword" size="29">

      </td>
  </tr>
  <tr>
    <td valign="top"></td>
    <td valign="top">
      <font face="Arial, Helvetica, sans-serif" size="-1">
      note: password is case-sensitive
      </font>
      </td>

  </tr>
  <tr>
    <td></td>
    <td valign="middle">
      <font face="Arial, Helvetica,sans-serif" size="-1">
      <input type="checkbox" name="remember" value="1">
      Remember my Address and Password (<a href="/exec/fd_helpWin?topic=5.1" target="_popup" onClick="window.open('/exec/fd_helpWin?topic=5.1','popup','width=600,height=425,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no'); return false;">what is this?</a>)
      </font>

      </td>
  </tr>
  <tr>
    <td></td>
    <td><br><input type=image name="Login" src="/images/login.gif" width="57" height="22" alt="Go" border="0"></td>
  </tr>
    <input type="hidden" name="action" value="login">

  </form>

  <tr>
    <td valign="top"></td>
    <td valign="top">
      <font face="Arial, Helvetica,sans-serif" size="-1">
     
      <br>
      <a href="/exec/fd_helpWin?topic=8" target="_popup" onClick="window.open('/exec/fd_helpWin?topic=8','popup','width=600,height=425,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no'); return false;">Log In Help</a>
      <br><br><br><br>
      </font>

    </td>
  </tr>
</table>
</center>

</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top