Problem with IE

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Dr.Pepper
Forum Newbie
Posts: 8
Joined: Wed Oct 15, 2003 4:10 pm

Problem with IE

Post by Dr.Pepper »

Hi.

I have a PHP script that outputs a form based on a mysql recordset.
the form works perfectly with mozilla/netscape but IE doesn't do anything when I press "Submit"..


There are about 55 records being displayed, and for each there are like 5 form objects (text,hidden and submit types)

Does anyone know if the is a limit to the amount of info in a form in IE?

I know this is a bit off topic, if I'm out of line please tell me so.
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post by microthick »

Can you post the url?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

I tried this (not sure it simulates your problem tho), and this works in IE and Mozilla Firebird. A total of 2001 input-fields within a form.

Code: Select all

<pre>
<?php
    if (isset($_POST)) {
        print_r($_POST);
    }
?>
<form method="post">
<input type="submit"><br>
<?php
    for($i=1;$i<1001;$i++) {
        echo '<input type="text" name="name'.$i.'" value="value'.$i.'">';
        echo '<input type="hidden" name="hidden'.$i.'" value="hidden'.$i.'">';
    }
?>
</form>
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Without looking at the code I'm just guessing. You said there are multiple forms on one page. That's OK in principle but do all the forms have a unique name?
Dr.Pepper
Forum Newbie
Posts: 8
Joined: Wed Oct 15, 2003 4:10 pm

Post by Dr.Pepper »

Ok here is the code
it is only one form..

i put an if clause to limit the result and if i do only 35 it works ok in IE

Code: Select all

<head>	
<LINK REL=STYLESHEET HREF='tfmdwell.css' TYPE='text/css'>
</head>
<?php
include_once 'date.inc';

echo "<h1>Arrived Units</h1>\n";
$msqlh = mysql_connect("xxx","xx","xx");
mysql_select_db("doublestackservices_com",$msqlh);
if ($submitted)
&#123;
	echo "entre";
	$arraylen = sizeof($month);
	for ($x=0 ; $x<$arraylen ;$x++)
	&#123;
		if (strlen($year&#1111;$x])==0)
		$year&#1111;$x]=2003;
		/*	$m=valid_month($month&#1111;$x]);
		$d=valid_day($day&#1111;$x]);
		$y=valid_year($year&#1111;$x]);
		//echo "$m , $d , $y<br>\n";*/
		if ( valid_month($month&#1111;$x]) and valid_day($day&#1111;$x]) and valid_year($year&#1111;$x]))
		&#123;
			$query="update tfmdwell set grounded='$year&#1111;$x]-$month&#1111;$x]-$day&#1111;$x]' where container='$cont&#1111;$x]'";
			
		//echo $query;
			$result = mysql_query($query,$msqlh);
			
		&#125;
		
		
		
	&#125;
&#125;

echo "<form action='show_arrived.php' method='get'>\n<INPUT type="submit" value="submit"><br><br>\n";
$rampasq = "select * from rampas order by aduana";
$rampas_result = mysql_query($rampasq,$msqlh);
while ($rampasrow = mysql_fetch_object($rampas_result))
&#123;
	
	$query = "select container,southbound_id,destination_ramp,status,arrived,nombre from tfmdwell,aduanas where destination_ramp=aduana and aduanas.seccion='0' and arrived!='0000-00-00 00:00:00' and grounded='0000-00-00 00:00:00' and aduana='$rampasrow->aduana' order by nombre,container";
	$result = mysql_query($query,$msqlh);
	$rsmex = mysql_num_rows($result);
	if ($rsmex>0)
	&#123;
		echo "<table border=1 cellpadding=1 cellspacing=0>\n<tr align=center>\n<th class=label colspan=4>$rampasrow->rampa</th>\n</tr>\n<tr>\n<th>Container</th><th>Status</th><th>Arrived</th><th>Grounded</th>\n</tr>\n";
		
		
		
		$x=0;
		while ($row = mysql_fetch_object($result))
		&#123;
			$x++;
			if(($x%2)==0)
			$class='class=alt';
			else
			$class='';
			//echo "<tr align=center>\n<td><input type=hidden name=cont&#1111;] ></td><td></td><td></td><td><input type=text name=month&#1111;] size=2 maxlength=2><input type=text name=day&#1111;] size=2 maxlength=2><input type=text name=year&#1111;] size=4 maxlength=4></td>\n</tr>\n";
			//if ($x<35)
				echo "<tr align=center &#123;$class&#125;>\n<td>&#123;$row->container&#125;<input type=hidden name=cont&#1111;] value=&#123;$row->container&#125;></td><td>&#123;$row->status&#125;</td><td>$row->arrived</td><td><input type=text name=month&#1111;] size=2 maxlength=2><input type=text name=day&#1111;] size=2 maxlength=2><input type=text name=year&#1111;] size=4 maxlength=4></td>\n</tr>\n";
		&#125;
		echo "<tr><td colspan=4 align=right>".$rsmex."</td></tr>";
		echo "
	</table>\n
	<input type="hidden" name="submitted" value="T">\n
	<INPUT type="submit" value="submit"><br><br>\n
	";	
	&#125;
	
&#125;
	/*	echo "
	</table>\n
	<input type="hidden" name="submitted" value="T">\n
	<INPUT type="submit" value="submit"><br><br>\n";*/
echo "</form>";
//&#125;
?>

the url is tumail.net/upmex
[/url]
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

You are not following any standards writing the html. Try changing these (all of them) and try again.

Code: Select all

// bad
<input type=hidden name=cont&#1111;] value=&#123;$row->container&#125;> 
// better
<input type="hidden" name="cont&#1111;]" value="&#123;$row->container&#125;">
Dr.Pepper
Forum Newbie
Posts: 8
Joined: Wed Oct 15, 2003 4:10 pm

Post by Dr.Pepper »

Ok, I will do that.

Thanks everyone
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

hmm...well you could add a search field there and the user would search by Container number, then you only need to show one item at a time...

this is what i had to do for a shopping cart, i would't even think of showing like 100+ item on a page, so i added a seach field, the user search for the item she/he wants to edit and BAM :D
Dr.Pepper
Forum Newbie
Posts: 8
Joined: Wed Oct 15, 2003 4:10 pm

Post by Dr.Pepper »

I tried using correct html (.ie value="xxx" instead of value=xxx) but the result is the same. I guessing I'm going to have to paginate the data, Unless you guys have more suggestions
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post by liljester »

when you run the page in IE, is there any HTML source?
Dr.Pepper
Forum Newbie
Posts: 8
Joined: Wed Oct 15, 2003 4:10 pm

Post by Dr.Pepper »

yes, there is and it seems ok to me. except when you click "submit" nothing happens

This behavior only happens when I display over 35 rows.

when i limit the rows it works without a hitch.
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post by microthick »

Hi Dr. Pepper,

I've been playing with the outputted code and it seems that it works when the form method is POST but not GET in Internet Explorer.
Dr.Pepper
Forum Newbie
Posts: 8
Joined: Wed Oct 15, 2003 4:10 pm

Post by Dr.Pepper »

ok let me try to switch the method
Dr.Pepper
Forum Newbie
Posts: 8
Joined: Wed Oct 15, 2003 4:10 pm

Post by Dr.Pepper »

you're right changing the method worked, but why is there a difference?
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

get method only allows up 80 characters in the address bar while post method has no limits! :D.
Post Reply