View Full Version : Javascript OnChange Show / Hide Issues

06-16-2009, 04:43 PM
Ok so I have a file called Login.php

What I need this to do is when a user selects League ID: ITT-A (or any other option) it will use the onchange function and show the next select menu that has the user names for that specific group (ITT-A in the example)

This is what I have so far:


<script type="text/javascript">
function showMenu(c) {
if(c=="Yes") {
else {
<title>In The Trenches</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
background-image: url("images/bg.JPG");
background-position: 50% 50%;
<body bgcolor=#ffffff leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>
<?php include("header.php"); ?>
<td height="27" valign="top" background="images/bgfiller.jpg">&nbsp;</td>
<td height="459" valign="top" background="images/bgfiller.jpg">&nbsp;</td>
<div align="center">
<form action="loginmeth.php" method="POST">
<table width="501" height="261" border="0">
<td colspan="3">&nbsp;</td>
<td height="33" colspan="3"><ul>
<strong>Login to Access This League</strong>
<td><div align="right">League ID:</div></td>
<select name="lid" id="lid" onchange="showMenu(this.value)" value="Yes">
<option value="" selected></option>
<option value="77366">In The Trenches-A</option>
<div id="lidd">
<td width="54">&nbsp;</td>
<td width="191" align="right">Login As:</td>
<td width="234">
<select name="fid" id="fid">
<option value="0000">Commissioner</option>
<option value="0001">Franchise 1</option>
<option value="0002">Franchise 2</option>
<option value="0003">Franchise 3</option>
<option value="0004">Franchise 4</option>
<option value="0005">Franchise 5</option>
<option value="0006">Franchise 6</option>
<option value="0007">Franchise 7</option>
<option value="0008">Franchise 8</option>
<option value="0009">Franchise 9</option>
<option value="0010">Franchise 10</option>
<td><div align="right">Password: </div></td>
<td><input type="password" name="password" id="password"></td>
<td><div align="right">Remember Me?</div></td>
<td><input name="radio" type="radio" id="yes" value="Yes" checked>
<input type="radio" name="radio2" id="no" value="No">
<td><input type="submit" value="Submit"></td>
<td height="33">&nbsp;</td>
<?php include("footer.php"); ?>

This is the Loginmeth.php that the form action calls:

$lid = $_REQUEST['lid'];
$fid = $_REQUEST['fid'];
$pass = $_REQUEST['password'];
$rem = $_REQUEST['remember'];

echo "<script type=\"text/javascript\"> window.location = \"http://football4.myfantasyleague.com/2009/login?L=77366&LEAGUE_ID=$lid&FRANCHISE_ID=$fid&PASSWORD=$pass&REMEMBER=$rem\" </script>"


What this login is for is a fantasy football league, and my client wants the login function to come from his website and submit through the form to the league manager (that we do not host) so this is the only way i could think of doing this without spending alot of time on it. But now i am having issues with the forms.

Eventually the username list will get too big so this is why i have to use this function so they can select there league ID>Username(this comes up after they select here league ID)>Password

The form works fine other than this issue..

Can anyone point me in the right direction with this?

Thank you for your time..