Page 1 of 1

This form works on other pages, but not current one

Posted: Tue Feb 28, 2006 9:13 pm
by davidprogramer

Code: Select all

$sql_ladders = sql_query("SELECT ladder_id, ladder_name	FROM ".$prefix."_league_ladders");

<form name=\"form1\" method=\"post\">
		Ladder: &nbsp<select name=\"menuJoinLadder\">";
	for ($m=1; $m < sql_num_rows($sql_ladders)+1; $m++)
	{
		list($ladder_id, $ladder_name) = sql_fetch_row($sql_ladders);
		echo "<option value=\"modules.php?name=League&file=join_ladder&lid=$m\">$ladder_name</option>";
	}
		echo "</select>&nbsp
		<input type=button name=ButtonGO value=Go onClick=\"MM_jumpMenuGo('menuJoinLadder','parent',0)\">
	</form>

I didn't modify the code at all on this page and it simply will NOT submit or change the page on this page. I don't understand why the go button will not work when it is clicked. Any help? I can post more code if asked to but this really is the main part of it. The combo box is populated correctly, but the go button just wont work.

Posted: Tue Feb 28, 2006 9:19 pm
by John Cartwright
try

1) Setting a form action
2) Your missing a slash .. look carefully ;)


<form name="form1\" method=\"post\">


Also,

Are you defining the javascript function in your second page?
MM_jumpMenuGo()

Posted: Tue Feb 28, 2006 9:26 pm
by davidprogramer
Yeah. Btw, the slash was on it in my script..I don't know why it isn't there..odd.


Here is the code from the FIRST page that WORKS:

Code: Select all

<?php
$index = 1;
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
include("header.php");
if (!defined('MODULE_FILE')) {
   die ("You can't access this file directly...");
}
opentable();
include("modules/League/includes/league_header.php");
require_once("modules/League/includes/league_functions.php");

$current_user = $cookie[0];

$sql_ladders = sql_query("SELECT ladder_id, ladder_name	FROM ".$prefix."_league_ladders");
echo "<center><font size=3><b>Clan Headquarters</b></font><br><br>";
	
echo "<center>
<table>
	<form name=\"form1\" method=\"post\">
		Ladder: &nbsp<select name=\"menuClanHQ\">";
	for ($m=1; $m < sql_num_rows($sql_ladders)+1; $m++)
	{
		list($ladder_id, $ladder_name) = sql_fetch_row($sql_ladders);
		echo "<option value=\"modules.php?name=League&file=clan_hq&op=load&view=roster&lid=$ladder_id\">$ladder_name</option>";
	}
		echo "</select>&nbsp
		<input type=\"button\" name=\"Button1\" value=\"Go\" onClick=\"MM_jumpMenuGo('menuClanHQ','parent',0)\">
	</form>
</table>
</center><br>";
Here is the code from the SECOND page that DOES NOT WORK:

Code: Select all

<html><title>All Out War : Join Ladder</title></html>
<?php
$index = 1;
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
include("header.php");
if (!defined('MODULE_FILE')) {
   die ("You can't access this file directly...");
}
opentable();
include("modules/League/includes/league_header.php");
require_once("modules/League/includes/league_functions.php");

$current_ladder = $_GET[lid];

$sql_ladders = sql_query("SELECT ladder_id, ladder_name	FROM ".$prefix."_league_ladders");

echo "<center>
<table>
	<form name=\"form1\" method=\"post\">
		Ladder: &nbsp<select name=\"menuJoinLadder\">";
	for ($m=1; $m < sql_num_rows($sql_ladders)+1; $m++)
	{
		list($ladder_id, $ladder_name) = sql_fetch_row($sql_ladders);
		echo "<option value=\"modules.php?name=League&file=join_ladder&lid=$m\">$ladder_name</option>";
	}
		echo "</select>&nbsp
		<input type=button name=ButtonGO value=Go onClick=\"MM_jumpMenuGo('menuJoinLadder','parent',0)\">
	</form>
</table>
</center><br>";
if ($current_ladder > 0){

edit: I just figured the problem out. header.php contains a piece of code somewhere that is allowing working it. I am betting that the function mmjumpmenugo is in header.php.

Posted: Tue Feb 28, 2006 9:34 pm
by John Cartwright
I am betting that the function mmjumpmenugo is in header.php.
your bet is the same as mine

Posted: Tue Feb 28, 2006 10:05 pm
by davidprogramer
It was a custom function that I made and I totally forgot about it. lol. It's fixed now. Sometimes all it takes is a little code comparing with something that works. :lol: Thanks :)