PDA

View Full Version : debug login form with drop down box


duggins
01-22-2004, 03:53 AM
<HTML>
<HEAD>
<TITLE>Mail Sys Login</TITLE>
<META NAME="GENERATOR" Content="Microsoft Visual Studio">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=UTF-8">
<SCRIPT LANGUAGE="JavaScript">

<!-- Original: Alex Tu <boudha1@hotmail.com> -->
<!-- Web Site: http://www.geocities.com/alex_2106 -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.page.userid.passwd.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>
</HEAD>
<BODY>

<center>
<form name="form">
<br><br>
EMAIL ADDRESS<br>
<INPUT type=hidden value=login name=page>
<INPUT style="FONT-SIZE: 10px" size=15 name=userid>
<br><br>
PASSWORD<br>
<INPUT style="FONT-SIZE: 10px" type=password size=15 value="" name=passwd>
<br><br>
<select name="site" size=1 ID=Select2>
<option value="">Go to....
<option value="http://mail.crystalauto.com:80/login.cgi">Casair Mail
<option value="http://mail.bearnet.net:80/login.cgi">Bearnet Mail
</select>
<br><br>
<input type=button value="Login" onClick="java script:formHandler(this)">
</form>
</center>

</BODY>
</HTML>

glenngv
01-22-2004, 05:37 AM
function formHandler(f){
if (f.site.selectedIndex>0) window.location.href=f.site.options[f.site.selectedIndex].value;
}
...
<input type="button" value="Login" onclick="formHandler(this.form)">

duggins
01-22-2004, 05:56 AM
strange no error on page, but the login info isn't passed, or atleast it doesn't seem to be for me will try uploading to a site.

glenngv
01-22-2004, 06:35 AM
It really won't pass the form data because you only redirect the page not submit it.

function formHandler(f){
if (f.site.selectedIndex>0) {
f.action=f.site.options[f.site.selectedIndex].value;
f.submit();
}
}

...
<form name="form" method="POST">
...
<input type="button" value="Login" onclick="formHandler(this.form)">
</form>

The form method depends on the way the cgi scripts access the fields, either GET or POST.