Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript OnChange Show / Hide Issues

    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:

    Login.php:

    Code:
    <html>
    <head>
    <script type="text/javascript">
    function showMenu(c) {
    if(c=="Yes") {
    document.getElementById("lidd").style.display="block";
    }
    else {
    document.getElementById("lidd").style.display="none";
    }
    }
    </script>
    <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%;
      background-repeat:repeat-y;
      background-color:#000000;
    }
    -->
    </style>
    </head>
    <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>
        </tr>
    	<tr></tr>
    	<tr>
    	  <td height="459" valign="top" background="images/bgfiller.jpg">&nbsp;</td>
        </tr>
    	<tr>
    	  <div align="center">
          <form action="loginmeth.php" method="POST">
    	    <table width="501" height="261" border="0">
              <tr>
                <td colspan="3">&nbsp;</td>
              </tr>
              <tr>
                <td height="33" colspan="3"><ul>
                  <strong>Login to Access This League</strong>
                </ul></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><div align="right">League ID:</div></td>
                <td><label>
                  <select name="lid" id="lid" onchange="showMenu(this.value)" value="Yes">
                  <option value="" selected></option>
                  <option value="77366">In The Trenches-A</option>
                  </select>
                </label></td>
              </tr>
              <div id="lidd">
              <tr>
                <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>
                  </select>
               </td>
              </tr>
              </div>
              <tr>
                <td>&nbsp;</td>
                <td><div align="right">Password: </div></td>
                <td><input type="password" name="password" id="password"></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><div align="right">Remember Me?</div></td>
                <td><input name="radio" type="radio" id="yes" value="Yes" checked>
                  Yes 
                  <input type="radio" name="radio2" id="no" value="No">
                  No</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td><input type="submit" value="Submit"></td>
              </tr>
            </table>
            </form>
    	    <p><br>
            </p>
          </div></td>
      </tr>
    	<tr>
    		<td height="33">&nbsp;</td>
    	</tr>
    </table>
    <?php include("footer.php"); ?>
    </body>
    </html>


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

    Code:
    <?php 
    $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..

    --Portwolf
    Last edited by Portwolf; 06-16-2009 at 03:48 PM.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •