Forms "Submit" works in Firefox, not in IE

W

wherewolf

I have a very simple test page that works just fine in Firefox 1.0 and
does not seem to work at all in IE6. Though the form is processed by
PHP, it doesn't seem as if it ever gets a chance to process when
clicking submit in IE. It doesn't matter if I am clicking on Submit or
hitting enter, btw.

Here is the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>test form</title>
</head>
<body>
Submit test page<br>
<br>
<form method="post" action="testcatch.php"
name="testform"><input size="15" name="firstname"><br>
<button value="submit" name="submit">Submit</button></form>
</body>
</html>

The testcatch.php file is:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>test catch</title>
</head>
<body>
test catch page... you get here by clicking Submit<br>
<?php $firstname = $_POST['firstname'];
echo "firstname = " . $firstname . "<br>";
?>
</body>
</html>
 
B

Beauregard T. Shagnasty

I have a very simple test page that works just fine in Firefox 1.0 and
does not seem to work at all in IE6. Though the form is processed by
PHP, it doesn't seem as if it ever gets a chance to process when
clicking submit in IE. It doesn't matter if I am clicking on Submit or
hitting enter, btw.

Here is the code:
<button value="submit" name="submit">Submit</button></form>

<input type="submit" value="Submit" name="submit">
 
D

David Dorward

I have a very simple test page that works just fine in Firefox 1.0 and
does not seem to work at all in IE6.
<button value="submit" name="submit">Submit</button></form>

IE is *very* buggy when it comes to <button> elements - generally you should
avoid them.
 
M

Michael Winter

Beauregard T. Shagnasty wrote:

[Replace BUTTON with:]
Or similarly put type="submit" on the original button element:

That may not be a good idea. IE's implementation of the BUTTON element
is broken. If the control is to become part of the form data set (the
original did have a name attribute), IE will submit the wrong data,
particularly if there are multiple BUTTON elements.

[snip]
It's strange that Mozilla accepts the original code.

Not at all. The default type for the BUTTON element is submit, but IE
implements this incorrectly, too.

Mike
 
S

Safalra

Michael said:
Not at all. The default type for the BUTTON element is submit, but IE
implements this incorrectly, too.

*checks DTD* Right you are. I guess I need to refresh my knowledge of
the default and implied values...
 
Joined
Oct 5, 2006
Messages
1
Reaction score
0
Very good answer...

Michael Winter said:
On 16/08/2005 15:56, Safalra wrote:
That may not be a good idea. IE's implementation of the BUTTON element
is broken. If the control is to become part of the form data set (the
original did have a name attribute), IE will submit the wrong data,
particularly if there are multiple BUTTON elements.

The html-specification defines "successfull controls":
http://www.w3.org/TR/html4/interact/forms.html#h-17.13.2

IE violates it completely - for buttons.

No Browser cares about "initial values" and changed "current values", as proposed but not required by the standard.
That means, you must compare each value against the "initial value" on the server side if you want to get changed elements only.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,197
Latest member
ScottChare

Latest Threads

Top