Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form button work in IE not mozilla

Status
Not open for further replies.

Gawain

Technical User
Sep 17, 2004
6
US
I am modifying an upload script to submit the number of files that will be uploaded, but the button that will be used to submit will not show up on the page. If I put the button tag before the form tag, it shows up, but will not submit the data. When I move the button to before the PHP code, the button shows up, but after the code, and the button will not show up. This page works just fine in IE.

here is the code for select.php
_________________________________________________________

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
<html xmlns="namespace" xml:lang="en" >

<head>

<title><?php echo $title_page; ?></title>

<meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />

<link rel="stylesheet" type="text/css" href="site_files/style/web.css" />

<link rel="Shortcut Icon" href="site_files/pictures/favicon.ico" />

<script type="text/javascript" src="site_files/ie_drop.js"></script>

</head>

<body>
<form action="upload.php" method="post">

<select name='num'>

<?php
for($i = 1; $i <= 5; $i++)
{
echo "<option value=".$i.">".$i."</option>";
}
?>

<br /><br />


</form>
<input type="button" value="Button" />

</body>
</html>


___________________________________________________________



Please help me...
Many thanks,
Bryan
 
Buttons belong in a form. That is how they know which data to send -- when you use multiple forms on the page. Move your button before the closing form tag and change it's type to submit.
Code:
<input type="submit" value="Button" />
 
and close the select tag.

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
I made the changes, but it still doesn't work in Firefox. The box with numbers still pop up, but the submit button still does not pop up.

Again, this upload script still works in Internet Explorer.

Below is the new script....

Can anyone figure out what the problem is?

Bryan

____________________________________________________________
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
<html xmlns="namespace" xml:lang="en" >

<head>

<title><?php echo $title_page; ?></title>

<meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />

<link rel="stylesheet" type="text/css" href="site_files/style/web.css" />

<link rel="Shortcut Icon" href="site_files/pictures/favicon.ico" />

<script type="text/javascript" src="site_files/ie_drop.js"></script>

</head>

<body>
<form action="upload.php" method="post">

<select name='num'>

<?php
for($i = 1; $i <= 5; $i++)
{
echo "<option value=".$i.">$i</option>";
}
?>

<br /><br />

<input type="submit" value="button" />

</select>
</form>


</body>
</html>
 
Close SELECT tag after PHP for() loop and before brbr input type="submit".
 
that works! Okay, so it was an issue with IE being too forgiving. Firefox was right with regard to the way that the HTML is processed...

Many thanks...

Bryan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top